fix welcome error

This commit is contained in:
Milka64 2021-01-04 18:31:32 +01:00
parent 3aea250608
commit de994a3592

View file

@ -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')])