better handling of AttributeError
This commit is contained in:
parent
0fc83134a9
commit
bc18614027
@ -82,6 +82,7 @@ async def leave(ctx):
|
||||
|
||||
await ctx.voice_client.disconnect()
|
||||
bot.queue = None
|
||||
shutil.rmtree('session/') # temporary cleanup procedure, will add caching later
|
||||
|
||||
@bot.command()
|
||||
async def skip(ctx):
|
||||
@ -141,6 +142,8 @@ async def start_playing(ctx):
|
||||
event = asyncio.Event()
|
||||
event.set()
|
||||
|
||||
try:
|
||||
|
||||
while bot.queue.has_next():
|
||||
|
||||
event.clear()
|
||||
@ -166,8 +169,13 @@ async def start_playing(ctx):
|
||||
|
||||
await event.wait()
|
||||
|
||||
await ctx.voice_client.disconnect()
|
||||
shutil.rmtree('session/') # temporary cleanup procedure, will add caching later
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
bot.queue = None
|
||||
|
||||
bot.start_playing = start_playing
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user