diff options
author | 2021-04-03 11:18:38 +0530 | |
---|---|---|
committer | 2021-04-03 11:18:38 +0530 | |
commit | 09eeac31df1fd9138d81d057829dd20cb8504ef9 (patch) | |
tree | 5c5eb60e06bd1fd7bc9c405b9e766a068e30b8c6 /bot | |
parent | Fix imports (diff) |
Use constants for delete delay and remove redundant f-string.
Diffstat (limited to 'bot')
-rw-r--r-- | bot/constants.py | 5 | ||||
-rw-r--r-- | bot/exts/evergreen/error_handler.py | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/bot/constants.py b/bot/constants.py index 416dd0e7..ba4345bc 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -20,6 +20,7 @@ __all__ = ( "Tokens", "Wolfram", "RedisConfig", + "RedirectOutput", "MODERATION_ROLES", "STAFF_ROLES", "WHITELISTED_CHANNELS", @@ -270,6 +271,10 @@ class Source: github_avatar_url = "https://avatars1.githubusercontent.com/u/9919" +class RedirectOutput: + delete_delay: int = 10 + + # Default role combinations MODERATION_ROLES = Roles.moderator, Roles.admin, Roles.owner STAFF_ROLES = Roles.helpers, Roles.moderator, Roles.admin, Roles.owner diff --git a/bot/exts/evergreen/error_handler.py b/bot/exts/evergreen/error_handler.py index 3d056f81..f74218b7 100644 --- a/bot/exts/evergreen/error_handler.py +++ b/bot/exts/evergreen/error_handler.py @@ -8,7 +8,7 @@ from discord import Embed, Message from discord.ext import commands from sentry_sdk import push_scope -from bot.constants import Channels, Colours, ERROR_REPLIES, NEGATIVE_REPLIES +from bot.constants import Channels, Colours, ERROR_REPLIES, NEGATIVE_REPLIES, RedirectOutput from bot.utils.decorators import InChannelCheckFailure, InMonthCheckFailure from bot.utils.exceptions import UserNotPlayingError @@ -159,8 +159,8 @@ class CommandErrorHandler(commands.Cog): misspelled_content = ctx.message.content e = Embed() e.set_author(name="Did you mean:", icon_url=QUESTION_MARK_ICON) - e.description = f"{misspelled_content.replace(command_name, similar_command_name, 1)}" - await ctx.send(embed=e, delete_after=10.0) + e.description = misspelled_content.replace(command_name, similar_command_name, 1) + await ctx.send(embed=e, delete_after=RedirectOutput.delete_delay) def setup(bot: commands.Bot) -> None: |