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