From 7fd4d9dc5f0a429295450956bf0a38828ad49517 Mon Sep 17 00:00:00 2001 From: BFlow Date: Wed, 29 Apr 2020 18:47:58 +0200 Subject: [PATCH] correction command play --- kabot/kabot/kabot.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index c85b116..09fd7b1 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -44,11 +44,13 @@ class Mybot(commands.Cog): self.sounds_history.reverse() if len(self.sounds_history) > 5: self.sounds_history = self.sounds_history[:5] - if audio_file.startswith('/tmp'): - os.remove(audio_file) #Fin des fonctions necesaire pour Kabot. #Les commandes pour interagir avec Kabot. + @commands.command(help='Clear sound queue') + async def clear(self, ctx): + self.sounds = [] + @commands.command() async def disconnect(self, ctx): await ctx.guild.voice_client.disconnect() @@ -108,10 +110,6 @@ class Mybot(commands.Cog): async def restart(self, ctx): await self.bot.logout() - @commands.command(help='Clear sound queue') - async def clear(self, ctx): - self.sounds = [] - @commands.command(help='Update local repo') async def update(self, message): output = Popen('git pull'.split(), stdout=PIPE).communicate()[0] @@ -272,7 +270,7 @@ class Mybot(commands.Cog): with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download([url]) info_dict = ydl.extract_info(url, download=False) - out_file = ydl.prepare_filename(info_dict) + out_file = ydl.prepare_filename(info_dict).replace(".webm", ".mp3") self.sounds.append((out_file, ctx)) @commands.command()