diff --git a/cogs/commands/__init__.py b/cogs/commands/__init__.py index 6f55dc7..9ebd402 100644 --- a/cogs/commands/__init__.py +++ b/cogs/commands/__init__.py @@ -4,6 +4,7 @@ Cog loader. Adds all command cogs to the bot. from nextcord.ext import commands +from cogs.commands.request import RequestCog from cogs.commands.test import TestCog @@ -13,4 +14,5 @@ def setup(bot: commands.Bot): """ Adds all command classes to bot. """ + bot.add_cog(RequestCog(bot)) bot.add_cog(TestCog(bot)) diff --git a/cogs/commands/request.py b/cogs/commands/request.py index 1e10088..a3d292f 100644 --- a/cogs/commands/request.py +++ b/cogs/commands/request.py @@ -5,12 +5,20 @@ Contains commands to request things from admins. import nextcord from nextcord.ext import commands +from config import DakinyConfig + class RequestCog(commands.Cog, name="Request Commands"): """ Class holds request commands. """ + def __init__(self, bot) -> None: + """ + Default constructor for RequestCog class. Does nothing. + """ + self.bot: commands.Bot = bot + @nextcord.slash_command() async def request(self, interaction: nextcord.Interaction): """ @@ -26,3 +34,8 @@ class RequestCog(commands.Cog, name="Request Commands"): interaction (nextcord.Interaction): Interaction that invoked the command. new_username(str): The username to change to. """ + + config: DakinyConfig = self.bot.config + content = f'<@{interaction.user.id}> would like to change their username to "{new_username}"' + await self.bot.get_channel(config.params.admin_channel_id).send(content=content) + await interaction.response.send_message("Request sent to admins.", ephemeral=True)