This commit is contained in:
Milka64 2021-02-18 22:08:17 +01:00
parent b719019dbd
commit 5207baf83f

View file

@ -247,9 +247,11 @@ class Mybot(commands.Cog):
audio_file = random.choice([f"{f}" for f in Path(self.audio_path + '/').glob('**/*.mp3')]) audio_file = random.choice([f"{f}" for f in Path(self.audio_path + '/').glob('**/*.mp3')])
else: else:
folder = folder.lower() folder = folder.lower()
audio_file = random.choice([f"{f}" for f in Path(self.audio_path + '/').glob('**/*.mp3') if folder in str(f).lower()]) audio_file = [f"{f}" for f in Path(self.audio_path + '/').glob('**/*.mp3') if folder in str(f).lower()]
if not audio_file: if not audio_file:
ctx.channel.send("%s not found" % folder) ctx.channel.send("%s not found" % folder)
else:
audio_file = random.choice(audio_file)
self.sounds.append((audio_file, ctx)) self.sounds.append((audio_file, ctx))
except: except:
e = exc_info()[0] e = exc_info()[0]