Some general cleanup
This commit is contained in:
@@ -36,7 +36,7 @@ class Admin(commands.Cog):
|
||||
@commands.is_owner()
|
||||
async def unload(self, ctx, *, cog: str):
|
||||
"""
|
||||
Used as 'unload cogs.COGNAME'
|
||||
Used as 'unload cogs.COGNAME'
|
||||
"""
|
||||
try:
|
||||
self.bot.unload_extension(cog)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""
|
||||
Some anime-related commands:
|
||||
- animepic
|
||||
- waifupic
|
||||
|
||||
|
||||
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
@@ -11,7 +13,7 @@ from discord.ext import commands
|
||||
import random
|
||||
|
||||
# IMPORTS - internal
|
||||
import loadconfig
|
||||
import loadmedia
|
||||
|
||||
# COG INIT
|
||||
class Anime(commands.Cog):
|
||||
@@ -19,18 +21,18 @@ class Anime(commands.Cog):
|
||||
self.bot = bot
|
||||
|
||||
# COG BODY
|
||||
@commands.command(name="animemedia")
|
||||
@commands.command(name="animepic")
|
||||
async def animemedia(self, ctx):
|
||||
"""
|
||||
Sends a random Anime gif or picture
|
||||
"""
|
||||
# Choose either a gif or a pic -> config/media.py
|
||||
media_type = random.choice(loadconfig.__media_anime__)
|
||||
|
||||
media_type = random.choice(loadmedia.__media_anime__)
|
||||
media = random.choice(media_type)
|
||||
await ctx.send(media)
|
||||
|
||||
@commands.command(name="animegirl", aliases=["waifu"])
|
||||
async def girlmedia(self, ctx, name: str):
|
||||
@commands.command(name="waifupic")
|
||||
async def waifumedia(self, ctx, name: str):
|
||||
"""
|
||||
Sends a random picture or gif of an Anime girl
|
||||
"""
|
||||
@@ -38,7 +40,7 @@ class Anime(commands.Cog):
|
||||
|
||||
if girl == "List":
|
||||
girl_list = ""
|
||||
for key in loadconfig.__media_girl__.keys():
|
||||
for key in loadmedia.__media_girl__.keys():
|
||||
if not girl_list:
|
||||
girl_list = girl_list + key
|
||||
else:
|
||||
@@ -48,7 +50,7 @@ class Anime(commands.Cog):
|
||||
|
||||
else:
|
||||
try:
|
||||
media = random.choice(loadconfig.__media_girl__[girl])
|
||||
media = random.choice(loadmedia.__media_girl__[girl])
|
||||
await ctx.send(media)
|
||||
except KeyError as error:
|
||||
text = (
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"""
|
||||
Some general commands:
|
||||
- about
|
||||
|
||||
https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html
|
||||
"""
|
||||
|
||||
@@ -10,7 +10,7 @@ from discord.ext import commands
|
||||
import random
|
||||
|
||||
# IMPORTS - internal
|
||||
import loadconfig
|
||||
import loadmedia
|
||||
|
||||
class MemeError(Exception):
|
||||
pass
|
||||
@@ -30,7 +30,7 @@ class Meme(commands.Cog):
|
||||
|
||||
if query == "List":
|
||||
meme_list = ""
|
||||
for key in loadconfig.__memes_list__.keys():
|
||||
for key in loadmedia.__memes_list__.keys():
|
||||
if not meme_list:
|
||||
meme_list = meme_list + key
|
||||
else:
|
||||
@@ -39,7 +39,7 @@ class Meme(commands.Cog):
|
||||
await ctx.send(f"Currently listed memes: `{meme_list}`")
|
||||
else:
|
||||
try:
|
||||
meme = random.choice(loadconfig.__memes_list__[query])
|
||||
meme = random.choice(loadmedia.__memes_list__[query])
|
||||
await ctx.send(meme)
|
||||
except KeyError as e:
|
||||
await ctx.send("Meme not found in database")
|
||||
|
||||
Reference in New Issue
Block a user