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 # INIT THE BOT
bot = commands.Bot( bot = commands.Bot(
command_prefix=loadconfig.__prefix__, 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' # LOAD COGS SPECIFIED IN 'config/cogs.py'
for cog in loadconfig.__cogs__: for cog in loadconfig.__cogs__:

View File

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

View File

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