diff --git a/cogs/moderation.py b/cogs/moderation.py index 166d75e2..bd55440f 100644 --- a/cogs/moderation.py +++ b/cogs/moderation.py @@ -34,13 +34,13 @@ class MessageFingerprint: attachment_urls: list[ str ] # the discord content URLs for each of the message's uploaded attachments - cached_attachment_hashes: set[ - Hash - ] | None = None # populated on the first call to `get_attachment_hashes` + cached_attachment_hashes: ( + set[Hash] | None + ) = None # populated on the first call to `get_attachment_hashes` - content_hash: Hash | None = ( - None # hash of the message body, after being passed through `filter_content` - ) + content_hash: ( + Hash | None + ) = None # hash of the message body, after being passed through `filter_content` # shortcut to build a fingerprint given a message @classmethod @@ -166,11 +166,8 @@ async def is_multipost_of(self, other: MessageFingerprint) -> bool: class Moderation(commands.Cog): def __init__(self, bot: commands.Bot) -> None: self.bot = bot - self.fingerprints: list[ - MessageFingerprint - ] = ( - [] - ) # stores all user messages sent in the last minute (recent messages near the end) + # stores all user messages sent in the last minute (recent messages near the end) + self.fingerprints: list[MessageFingerprint] = [] self.multipost_warnings: dict[ Annotated[int, "Multiposted Message ID"], tuple[ diff --git a/cogs/pubchem.py b/cogs/pubchem.py index 64a67a27..d922bb5c 100644 --- a/cogs/pubchem.py +++ b/cogs/pubchem.py @@ -1,6 +1,7 @@ from __future__ import annotations import asyncio +import string import pubchempy as pcp from discord import ApplicationContext, option @@ -49,7 +50,7 @@ def to_subscript(self, number: str) -> str: :type number: int :return: The subscripted version of the number. """ - return number.translate(str.maketrans("0123456789", "₀₁₂₃₄₅₆₇₈₉")) + return number.translate(str.maketrans(string.digits, "₀₁₂₃₄₅₆₇₈₉")) @commands.slash_command( name="chemsearch", diff --git a/cogs/staffapps_frontend.py b/cogs/staffapps_frontend.py index f58b9c75..a66c4f85 100644 --- a/cogs/staffapps_frontend.py +++ b/cogs/staffapps_frontend.py @@ -593,7 +593,7 @@ async def apply(self, ctx: discord.ApplicationContext) -> None: # check app status status = any( - x in [1, 3, 4, 5, 6, 7, 8] for x in applicant.status + x in (1, 3, 4, 5, 6, 7, 8) for x in applicant.status ) # 2 and 8 are closed applications, others are open if status: await ctx.respond(embed=embeds().ongoing(), ephemeral=True)