From f76171ac840eec61d2514ce6a085cdd50226ee9e Mon Sep 17 00:00:00 2001 From: imcompiling Date: Sun, 12 Feb 2023 20:52:28 -0500 Subject: [PATCH] Create simple help command for setting up. --- cogs/commands/__init__.py | 2 ++ cogs/commands/help.py | 47 +++++++++++++++++++++++++++++++++++++++ cogs/commands/set.py | 2 +- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 cogs/commands/help.py diff --git a/cogs/commands/__init__.py b/cogs/commands/__init__.py index 50750db..05bb85d 100644 --- a/cogs/commands/__init__.py +++ b/cogs/commands/__init__.py @@ -6,6 +6,7 @@ from nextcord.ext import commands from .create import CreateCog from .delete import DeleteCog +from .help import HelpCog from .refresh import RefreshCog from .set import SetCog from .update import UpdateCog @@ -19,6 +20,7 @@ def setup(bot: commands.Bot): """ bot.add_cog(CreateCog(bot)) bot.add_cog(DeleteCog()) + bot.add_cog(HelpCog()) bot.add_cog(RefreshCog(bot)) bot.add_cog(SetCog()) bot.add_cog(UpdateCog(bot)) diff --git a/cogs/commands/help.py b/cogs/commands/help.py new file mode 100644 index 0000000..5753a60 --- /dev/null +++ b/cogs/commands/help.py @@ -0,0 +1,47 @@ +""" +Commands for helping a user. +""" + +import nextcord +from nextcord.ext import commands + + +class HelpCog(commands.Cog, name="Help commands."): + """ + Class holds commands for getting help. + """ + + def __init__(self) -> None: + """ + Default constructor for HelpCog class. Does nothing. + """ + + @nextcord.slash_command() + async def help(self, interaction: nextcord.Interaction): + """ + Parent slash command for help. Never called. + """ + + @help.subcommand(description="Describes how to get started with Agon.") + async def setup(self, interaction: nextcord.Interaction): + """ + Sends a message describing how to get started with Agon. + + Args: + interaction (nextcord.Interaction): Interaction that invoked the command. + """ + + # I hate this but don't want indents in the string. + # pylint: disable=line-too-long + help_str: str = """Welcome to Agon! Three simple steps are needed to get started. +1.) Set a channel to recieve submission verifications with "/set verify_channel." +This channel is used to allow moderators to check if a submission is real/valid. + +2.) Set a channel for submissions to be posted in with "/set submission_channel." +This channel will be where all user submission messages are sent. + +3.) Set up your highscore tables! Use "/create group" to first create a group message in the channel you would like and then use "/create category" to create a category in that group message!""" + # pylint: enable=line-too-long + print(help_str) + + await interaction.response.send_message(content=help_str) diff --git a/cogs/commands/set.py b/cogs/commands/set.py index 82e738b..946d0a5 100644 --- a/cogs/commands/set.py +++ b/cogs/commands/set.py @@ -48,7 +48,7 @@ class SetCog(commands.Cog, name="Set command."): Command function to register a CategoryGroup's output channel. Args: - interaction (nextcord.Interaction): Interaction that invoked the command + interaction (nextcord.Interaction): Interaction that invoked the command. group_id (str): String representation of Group id to register channel to. Is SlashOption. channel (nextcord.abc.GuildChannel, optional): Channel to register Is a SlashOption. Limited to text channels, Defaults to None.