WIP on #11
This commit is contained in:
parent
b719019dbd
commit
5207baf83f
1 changed files with 4 additions and 2 deletions
|
@ -247,10 +247,12 @@ class Mybot(commands.Cog):
|
|||
audio_file = random.choice([f"{f}" for f in Path(self.audio_path + '/').glob('**/*.mp3')])
|
||||
else:
|
||||
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:
|
||||
ctx.channel.send("%s not found" % folder)
|
||||
self.sounds.append((audio_file, ctx))
|
||||
else:
|
||||
audio_file = random.choice(audio_file)
|
||||
self.sounds.append((audio_file, ctx))
|
||||
except:
|
||||
e = exc_info()[0]
|
||||
await ctx.channel.send("Exception when calling joke: %s\n" % e)
|
||||
|
|
Loading…
Reference in a new issue