wait for leave vocal before restart #41
This commit is contained in:
parent
502911be81
commit
283a3919f0
1 changed files with 3 additions and 3 deletions
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue