Closed AAA3A-AAA3A closed 3 years ago
This pull request introduces 1 alert when merging e5985ad8d442dd53b0ccfaa4f655767d00367132 into ba62ca36adc16e42eaf6bf7e3bc0f64242e704f8 - view on LGTM.com
new alerts:
Just needs a small correction, an if condition to check if the bot has permissions to delete the user message.
diff --git a/customhelp/core/base_help.py b/customhelp/core/base_help.py
--- customhelp/core/base_help.py
+++ customhelp/core/base_help.py
@@ -125,12 +125,10 @@
"""
help_settings = await HelpSettings.from_context(ctx)
- delete_message = await self.config.settings.deletemessage()
- if delete_message:
- if ctx.channel.permissions_for(ctx.me).manage_messages:
- await ctx.message.delete()
+ if ctx.channel.permissions_for(ctx.me).manage_messages and await self.config.settings.deletemessage():
+ await ctx.message.delete()
if help_for is None or isinstance(help_for, dpy_commands.bot.BotBase):
await self.format_bot_help(ctx, help_settings=help_settings)
return
This pull request introduces 1 alert when merging 64ad4f360c7e2978d708ce4b388e837cc15abd74 into ba62ca36adc16e42eaf6bf7e3bc0f64242e704f8 - view on LGTM.com
new alerts:
LGTM, thanks
Hello, Here is the code allowing the bot to delete the message that called the help menu. This feature is disabled by default and can be enabled by the bot owner with the command "[p]chelp settings deletemessage 1". Thanks in advance and have a nice day.