diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index 7f2dbe0..26c99c3 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -437,7 +437,7 @@ class Mybot(commands.Cog): user = ctx.message.author.name print(user) try: - audio_file = random.choice([f for f in os.listdir(audio_path + '/%s/' % user) if f.endswith('.mp3')]) + audio_file = random.choice([f for f in os.listdir(self.audio_path + '/%s/' % user) if f.endswith('.mp3')]) audio_file = self.audio_path + '/%s/' % user + audio_file except: audio_file = random.choice([f"{f}" for f in Path(self.audio_path + '/').glob('**/*.mp3')])