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()