✨ reworking a bunch of stuff
This commit is contained in:
32
gwendolyn_old/cogs/lookup_cog.py
Normal file
32
gwendolyn_old/cogs/lookup_cog.py
Normal file
@ -0,0 +1,32 @@
|
||||
"""Contains the LookupCog, which deals with the lookup commands."""
|
||||
from discord.ext import commands # Has the cog class
|
||||
from interactions import cog_ext # Used for slash commands
|
||||
|
||||
from gwendolyn_old.utils import get_params # pylint: disable=import-error
|
||||
|
||||
params = get_params()
|
||||
|
||||
|
||||
class LookupCog(commands.Cog):
|
||||
"""Contains the lookup commands."""
|
||||
|
||||
def __init__(self, bot):
|
||||
"""Initialize the cog."""
|
||||
self.bot = bot
|
||||
|
||||
# Looks up a spell
|
||||
@cog_ext.cog_slash(**params["spell"])
|
||||
async def spell(self, ctx, query):
|
||||
"""Look up a spell."""
|
||||
await self.bot.lookup_funcs.spell_func(ctx, query)
|
||||
|
||||
# Looks up a monster
|
||||
@cog_ext.cog_slash(**params["monster"])
|
||||
async def monster(self, ctx, query):
|
||||
"""Look up a monster."""
|
||||
await self.bot.lookup_funcs.monster_func(ctx, query)
|
||||
|
||||
|
||||
def setup(bot):
|
||||
"""Add the cog to the bot."""
|
||||
bot.add_cog(LookupCog(bot))
|
Reference in New Issue
Block a user