From 6623dfdb1ac2df6973a45699da91b19d769b29ba Mon Sep 17 00:00:00 2001 From: Jey0 Date: Sun, 3 Sep 2023 21:19:44 -0400 Subject: [PATCH] Fix pylint --- src/bot/custom_help_command.py | 25 +++++++++++++++++++------ src/bot/root_pythia_bot.py | 6 ++++-- src/bot/root_pythia_cogs.py | 4 +++- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/bot/custom_help_command.py b/src/bot/custom_help_command.py index b917af8..bfb67dc 100644 --- a/src/bot/custom_help_command.py +++ b/src/bot/custom_help_command.py @@ -13,7 +13,7 @@ class RootPythiaHelpCommand(HelpCommand): """ def get_command_signature(self, command): - return '%s %s' % (command.qualified_name, command.signature) + return f"{command.qualified_name} {command.signature}" async def send_bot_help(self, mapping): # color attribute sets color of the border on the left @@ -31,7 +31,9 @@ async def send_bot_help(self, mapping): await self.get_destination().send(embed=embed) async def send_command_help(self, command): - embed = discord.Embed(title=self.get_command_signature(command), color=discord.Color.blurple()) + embed = discord.Embed( + title=self.get_command_signature(command), + color=discord.Color.blurple()) if command.help: embed.description = command.help @@ -41,20 +43,31 @@ async def send_command_help(self, command): await self.get_destination().send(embed=embed) async def send_group_help(self, group): - embed = discord.Embed(title=self.get_command_signature(group), description=group.help, color=discord.Color.blurple()) + embed = discord.Embed( + title=self.get_command_signature(group), + description=group.help, + color=discord.Color.blurple()) if filtered_commands := await self.filter_commands(group.commands): for command in filtered_commands: - embed.add_field(name=self.get_command_signature(command), value=command.help or "No Help Message Found... ") + embed.add_field( + name=self.get_command_signature(command), + value=command.help or "No Help Message Found... ") await self.get_destination().send(embed=embed) async def send_cog_help(self, cog): - embed = discord.Embed(title=cog.qualified_name or "No Category", description=cog.description, color=discord.Color.blurple()) + embed = discord.Embed( + title=cog.qualified_name or "No Category", + description=cog.description, + color=discord.Color.blurple()) if filtered_commands := await self.filter_commands(cog.get_commands()): for command in filtered_commands: - embed.add_field(name=self.get_command_signature(command), value=command.help or "No Help Message Found... ", inline=False) + embed.add_field( + name=self.get_command_signature(command), + value=command.help or "No Help Message Found... ", + inline=False) await self.get_destination().send(embed=embed) diff --git a/src/bot/root_pythia_bot.py b/src/bot/root_pythia_bot.py index f87cdcc..28b41b1 100644 --- a/src/bot/root_pythia_bot.py +++ b/src/bot/root_pythia_bot.py @@ -29,11 +29,13 @@ def craft_intents(): # Warning: message_content is a privileged intents # you must authorize it in the discord dev portal https://discord.com/developers/applications # enbale message_content privilegied intent to enable commands - # More info: https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Intents.message_content + # More info below: + # https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Intents.message_content intents.message_content = True # enable guild messages related events - # More info: https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Intents.guild_messages + # More info below: + # https://docs.pycord.dev/en/stable/api/data_classes.html#discord.Intents.guild_messages intents.guild_messages = True return intents diff --git a/src/bot/root_pythia_cogs.py b/src/bot/root_pythia_cogs.py index a3857f7..529c86a 100644 --- a/src/bot/root_pythia_cogs.py +++ b/src/bot/root_pythia_cogs.py @@ -85,7 +85,9 @@ async def addusers(self, ctx, *user_ids): Add several rootme users with [user_ids...] to the tracked users (each id is separated by a whitespace when using the command) """ - self.logger.info("command `addusers` received '%s' arguments: '%s'", len(user_ids), user_ids) + self.logger.info( + "command `addusers` received '%s' arguments: '%s'", len(user_ids), user_ids + ) for user_id in user_ids: try: user_id = int(user_id)