From 70e612882d1093b133d13302dccfba6aa2778474 Mon Sep 17 00:00:00 2001 From: Parker Date: Thu, 31 Oct 2024 00:26:00 -0500 Subject: `black --line-length 79` --- code/cogs/help.py | 123 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 93 insertions(+), 30 deletions(-) (limited to 'code/cogs/help.py') diff --git a/code/cogs/help.py b/code/cogs/help.py index 97af668..ea54058 100644 --- a/code/cogs/help.py +++ b/code/cogs/help.py @@ -13,32 +13,51 @@ commands_and_descriptions = { "skip": { "description": "Skips the song that is currently playing", "optional_arguments": { - "number": "The number of songs to skip - leave blank to skip just the current song" + "number": ( + "The number of songs to skip - leave blank to skip just the" + " current song" + ) }, "usage": "/skip (number)", }, "queue": { "description": "Sends the songs currently added to the queue", "optional_arguments": { - "page": "Page number of the queue to view - leave blank to see only the first page" + "page": ( + "Page number of the queue to view - leave blank to see only" + " the first page" + ) }, "usage": "/queue (page)", }, "stop": { - "description": "Stops all music, clears the queue, and leave the voice channel", + "description": ( + "Stops all music, clears the queue, and leave the voice channel" + ), "usage": "/stop", }, - "np": {"description": "Sends the song that is currently playing", "usage": "/np"}, - "clear": {"description": "Removes all songs from the queue", "usage": "/clear"}, + "np": { + "description": "Sends the song that is currently playing", + "usage": "/np", + }, + "clear": { + "description": "Removes all songs from the queue", + "usage": "/clear", + }, "remove": { "description": "Removes the specified song from the queue", "arguments": { - "number": "The queue number of the song that should be removed from the queue" + "number": ( + "The queue number of the song that should be removed from the" + " queue" + ) }, "usage": "/remove ", }, "autoplay": { - "description": "Keep the music playing forever with music suggestions from OpenAI", + "description": ( + "Keep the music playing forever with music suggestions from OpenAI" + ), "arguments": { "on": "Turn autoplay feature on", "off": "Turn autoplay feature off", @@ -49,7 +68,9 @@ commands_and_descriptions = { "description": "Changes the looping state of the bot", "arguments": { "song": "Repeats the song that is currently playing until changed", - "queue": "Continuously repeat the songs in the queue until turned off", + "queue": ( + "Continuously repeat the songs in the queue until turned off" + ), "off": "Stop all song or queue repetition", }, "usage": "/repeat ", @@ -79,11 +100,15 @@ commands_and_descriptions = { "usage": "/news", }, "bug": { - "description": "Fill out a bug report form to alert the developer of issues", + "description": ( + "Fill out a bug report form to alert the developer of issues" + ), "usage": "/bug", }, "feedback": { - "description": "Fill out a form to give the developer feedback on the bot", + "description": ( + "Fill out a form to give the developer feedback on the bot" + ), "usage": "/feedback", }, } @@ -93,7 +118,11 @@ class HelpView(discord.ui.View): def __init__(self, timeout=180.0): super().__init__(timeout=timeout) if BOT_INVITE_LINK: - self.add_item(discord.ui.Button(label="Invite Me", url=BOT_INVITE_LINK, row=1)) + self.add_item( + discord.ui.Button( + label="Invite Me", url=BOT_INVITE_LINK, row=1 + ) + ) @discord.ui.button( label="View All Commands", style=discord.ButtonStyle.green, row=1 @@ -103,14 +132,20 @@ class HelpView(discord.ui.View): ): embed = discord.Embed( title=":musical_note: All Commands :musical_note:", - description="**Check out recent news and updates about the bot with the command!\n\u200b**", + description=( + "**Check out recent news and updates about the bot with the" + " command!\n\u200b**" + ), color=BOT_COLOR, ) embed.add_field( name="All Commands", value=", ".join( - [f"`{command}`" for command in commands_and_descriptions.keys()] + [ + f"`{command}`" + for command in commands_and_descriptions.keys() + ] ), ) @@ -122,30 +157,48 @@ class Help(commands.Cog): self.bot = bot @app_commands.command() - @app_commands.describe(command="Name of the command you want more information on") - async def help(self, interaction: discord.Interaction, command: str = None): + @app_commands.describe( + command="Name of the command you want more information on" + ) + async def help( + self, interaction: discord.Interaction, command: str = None + ): "Sends the bots commands" if command == None: embed = discord.Embed( title=f":musical_note: Help :musical_note:", - description="**Check out recent news and updates about the bot with the command!\n\u200b**", + description=( + "**Check out recent news and updates about the bot with" + " the command!\n\u200b**" + ), color=BOT_COLOR, ) embed.add_field( name="**Use Me**", - value="> To get started, use the command and enter the name or link to the song of your choice.", + value=( + "> To get started, use the " + " command and enter the name or link to the song of your" + " choice." + ), inline=False, ) embed.add_field( name="**Full Command List**", - value='> To view of a list of all available commands, click the "View All Commands" button below.', + value=( + "> To view of a list of all available commands, click the" + ' "View All Commands" button below.' + ), inline=False, ) embed.add_field( name="**Help for Specific Commands**", - value="> If you want more information on how to use a specific command, use the command and include the specific command.", + value=( + "> If you want more information on how to use a specific" + " command, use the command and" + " include the specific command." + ), inline=False, ) @@ -160,16 +213,18 @@ class Help(commands.Cog): command = command.lower().strip() embed = discord.Embed( title=f"**{command}**", - description=f"{commands_and_descriptions[command]['description']}", + description=( + f"{commands_and_descriptions[command]['description']}" + ), color=BOT_COLOR, ) try: if commands_and_descriptions[command]["arguments"]: arguments_value = "" - for argument, explanation in commands_and_descriptions[command][ - "arguments" - ].items(): + for argument, explanation in commands_and_descriptions[ + command + ]["arguments"].items(): arguments_value += f"{argument}\n> {explanation}\n\n" embed.add_field( @@ -181,28 +236,36 @@ class Help(commands.Cog): try: if commands_and_descriptions[command]["optional_arguments"]: arguments_value = "" - for argument, explanation in commands_and_descriptions[command][ - "optional_arguments" - ].items(): + for argument, explanation in commands_and_descriptions[ + command + ]["optional_arguments"].items(): arguments_value += f"{argument}\n> {explanation}\n\n" embed.add_field( - name="Optional Arguments", value=arguments_value, inline=False + name="Optional Arguments", + value=arguments_value, + inline=False, ) except KeyError: pass embed.add_field( - name="Usage", value=f"` {commands_and_descriptions[command]['usage']} `" + name="Usage", + value=f"` {commands_and_descriptions[command]['usage']} `", ) embed.set_thumbnail(url=self.bot.user.avatar.url) - await interaction.response.send_message(embed=embed, ephemeral=True) + await interaction.response.send_message( + embed=embed, ephemeral=True + ) else: embed = discord.Embed( title="Command Doesn't Exist", - description=f"The command you entered (` {command} `) does not exist, please try again with a different command name.", + description=( + f"The command you entered (` {command} `) does not exist," + " please try again with a different command name." + ), color=BOT_COLOR, ) -- cgit v1.2.3-70-g09d2