diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index 0d6b833..496dfda 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -199,10 +199,10 @@ class Mybot(commands.Cog): async def joke(self, ctx, folder=None): user = ctx.message.author.name if not folder or not ctx.message.content: - audio_file = random.choice([f for f in Path(here + '/Audio/').glob('**/*.mp3')]) + audio_file = random.choice([f"{f}" for f in Path(here + '/Audio/').glob('**/*.mp3')]) else: folder = folder.lower() - audio_file = random.choice([f for f in Path(here + '/Audio/').glob('**/*.mp3') if folder in str(f).lower()]) + audio_file = random.choice([f"{f}" for f in Path(here + '/Audio/').glob('**/*.mp3') if folder in str(f).lower()]) self.sounds.append((audio_file, ctx)) @commands.command(help="optionnal args : [livre] [character]") @@ -386,7 +386,7 @@ class Mybot(commands.Cog): audio_file = random.choice([f for f in os.listdir(here + '/Audio/%s/' % user) if f.endswith('.mp3')]) audio_file = here + '/Audio/%s/' % user + audio_file except: - audio_file = random.choice([f for f in Path(here + '/Audio/').glob('**/*.mp3')]) + audio_file = random.choice([f"{f}" for f in Path(here + '/Audio/').glob('**/*.mp3')]) self.sounds.append((audio_file, ctx)) #Fin des commandes pour faire mumuse avec Kabot.