diff --git a/src/scanners/scanner.py b/src/scanners/scanner.py index b642594..e5b41b4 100644 --- a/src/scanners/scanner.py +++ b/src/scanners/scanner.py @@ -67,7 +67,7 @@ class Scanner(ABC): try: with GuildLogs(guild) as logs: # If "%cmd help" redirect to "%help cmd" - if "help" in args: + if len(args) > 1 and args[1] == "help": await client.bot.help(client, message, "help", args[0]) return @@ -98,6 +98,7 @@ class Scanner(ABC): and arg not in str_mentions and arg not in other_mentions and not skip_check + and len(arg) > 0 ): if self.all_args: self.other_args += [arg] diff --git a/src/utils/command_cache.py b/src/utils/command_cache.py index 4cdbf7b..252313e 100644 --- a/src/utils/command_cache.py +++ b/src/utils/command_cache.py @@ -23,7 +23,7 @@ async def repeat( *args: str, add_args: List[str] = [], ): - if "help" in args: + if len(args) > 1 and args[1] == "help": await client.bot.help(client, message, "help", args[0]) return id = message.channel.id diff --git a/src/utils/gdpr.py b/src/utils/gdpr.py index d913f5c..e14fdb4 100644 --- a/src/utils/gdpr.py +++ b/src/utils/gdpr.py @@ -49,10 +49,10 @@ async def process(client: discord.client, message: discord.Message, *args: str): args = list(args) if len(args) == 1: await message.channel.send(TEXT) - elif len(args) > 2: - await message.channel.send(f"Too many arguments", reference=message) elif args[1] == "help": await client.bot.help(client, message, "help", args[0]) + elif len(args) > 2: + await message.channel.send(f"Too many arguments", reference=message) elif args[1] in ["agree", "accept"]: GuildLogs.init_log(message.channel.guild) await message.channel.send(AGREE_TEXT, reference=message)