From 36afd0d586356bc714806174708d0453cc3654b8 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sat, 30 Oct 2021 14:57:25 +0000 Subject: [PATCH 1/2] Merge collapsible `if` statements --- .../bot_files/cogs/events/bot_events.py | 17 ++++++++++------- .../bot_files/cogs/moderation/moderation.py | 5 ++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/minato_namikaze/bot_files/cogs/events/bot_events.py b/minato_namikaze/bot_files/cogs/events/bot_events.py index af9e85ac..949ef379 100644 --- a/minato_namikaze/bot_files/cogs/events/bot_events.py +++ b/minato_namikaze/bot_files/cogs/events/bot_events.py @@ -271,15 +271,18 @@ async def on_member_unban(self, guild, user): # on message event @commands.Cog.listener() async def on_message(self, message): - if (self.bot.user.mentioned_in(message) and + if ( + (self.bot.user.mentioned_in(message) and message.mention_everyone is False and message.content.lower() - in ("<@!779559821162315787>", "<@779559821162315787>") or + in ("<@!779559821162315787>", "<@779559821162315787>") + or message.content.lower() in ("<@!779559821162315787> prefix", - "<@779559821162315787> prefix")): - if not message.author.bot: - await message.channel.send( - "The prefix is **)** ,A full list of all commands is available by typing ```)help```" - ) + "<@779559821162315787> prefix")) + and not message.author.bot + ): + await message.channel.send( + "The prefix is **)** ,A full list of all commands is available by typing ```)help```" + ) def setup(bot): diff --git a/minato_namikaze/bot_files/cogs/moderation/moderation.py b/minato_namikaze/bot_files/cogs/moderation/moderation.py index 7cc1a3df..3133f26b 100644 --- a/minato_namikaze/bot_files/cogs/moderation/moderation.py +++ b/minato_namikaze/bot_files/cogs/moderation/moderation.py @@ -761,9 +761,8 @@ def predicate(m): return not r return r - if args.after: - if args.search is None: - args.search = 2000 + if args.after and args.search is None: + args.search = 2000 if args.search is None: args.search = 100 From 72a34961e91921aa9187749586203a5e836a2cb4 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sat, 30 Oct 2021 14:57:42 +0000 Subject: [PATCH 2/2] Format code with black, yapf, autopep8 and isort --- minato_namikaze/bot_files/cogs/events/bot_events.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/minato_namikaze/bot_files/cogs/events/bot_events.py b/minato_namikaze/bot_files/cogs/events/bot_events.py index 949ef379..51bf478a 100644 --- a/minato_namikaze/bot_files/cogs/events/bot_events.py +++ b/minato_namikaze/bot_files/cogs/events/bot_events.py @@ -271,15 +271,12 @@ async def on_member_unban(self, guild, user): # on message event @commands.Cog.listener() async def on_message(self, message): - if ( - (self.bot.user.mentioned_in(message) and + if (self.bot.user.mentioned_in(message) and message.mention_everyone is False and message.content.lower() in ("<@!779559821162315787>", "<@779559821162315787>") - or - message.content.lower() in ("<@!779559821162315787> prefix", - "<@779559821162315787> prefix")) - and not message.author.bot - ): + or message.content.lower() in + ("<@!779559821162315787> prefix", + "<@779559821162315787> prefix")) and not message.author.bot: await message.channel.send( "The prefix is **)** ,A full list of all commands is available by typing ```)help```" )