diff options
author | 2021-08-24 16:09:39 +0100 | |
---|---|---|
committer | 2021-08-24 16:41:47 +0100 | |
commit | 5998a8e0df0b133bc8bc0ac1eaf25d0b4681ccb0 (patch) | |
tree | 80879a73b16a3b6c0f89fa6ffbba5dbeb75ce80a | |
parent | Allow partners & members of the python community to bypass cooldown and use `... (diff) |
Minor linting fixes
-rw-r--r-- | bot/exts/utils/reminders.py | 7 | ||||
-rw-r--r-- | bot/exts/utils/utils.py | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/bot/exts/utils/reminders.py b/bot/exts/utils/reminders.py index 8aa437895..a97080a4c 100644 --- a/bot/exts/utils/reminders.py +++ b/bot/exts/utils/reminders.py @@ -11,7 +11,10 @@ from dateutil.parser import isoparse from discord.ext.commands import Cog, Context, Greedy, group from bot.bot import Bot -from bot.constants import Guild, Icons, MODERATION_ROLES, POSITIVE_REPLIES, Roles, STAFF_PARTNERS_COMMUNITY_ROLES, STAFF_ROLES +from bot.constants import ( + Guild, Icons, MODERATION_ROLES, POSITIVE_REPLIES, + Roles, STAFF_PARTNERS_COMMUNITY_ROLES, STAFF_ROLES +) from bot.converters import Duration from bot.pagination import LinePaginator from bot.utils.checks import has_any_role_check, has_no_roles_check @@ -136,7 +139,7 @@ class Reminders(Cog): """Converts Role and Member ids to their corresponding objects if possible.""" guild = self.bot.get_guild(Guild.id) for mention_id in mention_ids: - if (mentionable := (guild.get_member(mention_id) or guild.get_role(mention_id))): + if mentionable := (guild.get_member(mention_id) or guild.get_role(mention_id)): yield mentionable def schedule_reminder(self, reminder: dict) -> None: diff --git a/bot/exts/utils/utils.py b/bot/exts/utils/utils.py index c131213e7..c4a466943 100644 --- a/bot/exts/utils/utils.py +++ b/bot/exts/utils/utils.py @@ -55,15 +55,17 @@ class Utils(Cog): """Shows you information on up to 50 unicode characters.""" match = re.match(r"<(a?):(\w+):(\d+)>", characters) if match: - return await messages.send_denial( + await messages.send_denial( ctx, "**Non-Character Detected**\n" "Only unicode characters can be processed, but a custom Discord emoji " "was found. Please remove it and try again." ) + return if len(characters) > 50: - return await messages.send_denial(ctx, f"Too many characters ({len(characters)}/50)") + await messages.send_denial(ctx, f"Too many characters ({len(characters)}/50)") + return def get_info(char: str) -> Tuple[str, str]: digit = f"{ord(char):x}" |