Create initial command action.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user