Improve animegirl command

This commit is contained in:
CramMK
2020-04-24 10:58:27 +02:00
parent 6fbdd29e5b
commit bd7c614220
3 changed files with 23 additions and 11 deletions

View File

@@ -32,7 +32,7 @@ import loadconfig
# INIT THE BOT
bot = commands.Bot(
command_prefix=loadconfig.__prefix__,
description="Holy Goddess Aqua!")
description="Holy Goddess Aqua! - for further help on a command, use the argument `list`")
# LOAD COGS SPECIFIED IN 'config/cogs.py'
for cog in loadconfig.__cogs__:

View File

@@ -36,14 +36,26 @@ class Anime(commands.Cog):
"""
# config/media.py
girl = query.capitalize()
try:
media = random.choice(loadconfig.__media_girl__[girl])
await ctx.send(media)
except KeyError as error:
text = (
f"Girl `{girl}` not found in database!\n"
"It probably sucks...")
await ctx.send(text)
if girl == "List":
girl_list = ""
for key in loadconfig.__media_girl__.keys():
if not girl_list:
girl_list = girl_list + key
else:
girl_list = girl_list + ", " + key
await ctx.send(f"Currently listed girls: `{girl_list}`")
else:
try:
media = random.choice(loadconfig.__media_girl__[girl])
await ctx.send(media)
except KeyError as error:
text = (
f"Girl `{girl}` not found in database!\n"
"It probably sucks...")
await ctx.send(text)
# COG ENDING

View File

@@ -48,6 +48,6 @@ __media_girl__ = {
}
__olli_memes__ = [
"https://i.imgflip.com/3xpkiv.jpg"
"https://cdn.discordapp.com/attachments/541637988120133634/702992838702399518/grave.png"
"https://i.imgflip.com/3xpkiv.jpg",
"https://cdn.discordapp.com/attachments/541637988120133634/702992838702399518/grave.png",
]