wait for leave vocal before restart #41

This commit is contained in:
Milka64 2020-12-13 16:25:37 +01:00
parent 502911be81
commit 283a3919f0

View file

@ -91,7 +91,7 @@ class Mybot(commands.Cog):
os.remove("/tmp/" + fichier)
@commands.command()
async def disconnect(self, ctx):
async def leave(self, ctx):
if ctx.voice_client.is_connected():
await ctx.guild.voice_client.disconnect()
@ -154,8 +154,8 @@ class Mybot(commands.Cog):
@commands.command(help='Restart Bot')
async def restart(self, ctx):
cmd = self.bot.get_command('disconnect')
await cmd.invoke(ctx)
cmd = self.bot.get_command('leave')
cmd.invoke(ctx)
await self.bot.close()
exit()