diff options
| author | 2023-05-06 16:12:32 +0100 | |
|---|---|---|
| committer | 2023-05-09 15:41:50 +0100 | |
| commit | 613840ebcf303e84048d48ace37fb001c1afe687 (patch) | |
| tree | 9acaf0bae0527fe8389483a419b44e06997ca060 /bot/exts/holidays/halloween/candy_collection.py | |
| parent | Migrate to ruff (diff) | |
Apply fixes for ruff linting
Co-authored-by: wookie184 <[email protected]>
Co-authored-by: Amrou Bellalouna <[email protected]>
Diffstat (limited to 'bot/exts/holidays/halloween/candy_collection.py')
| -rw-r--r-- | bot/exts/holidays/halloween/candy_collection.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bot/exts/holidays/halloween/candy_collection.py b/bot/exts/holidays/halloween/candy_collection.py index 683114f9..ca68888b 100644 --- a/bot/exts/holidays/halloween/candy_collection.py +++ b/bot/exts/holidays/halloween/candy_collection.py @@ -1,6 +1,5 @@ import logging import random -from typing import Union import discord from async_rediscache import RedisCache @@ -18,17 +17,17 @@ ADD_CANDY_EXISTING_REACTION_CHANCE = 10 # 10% ADD_SKULL_REACTION_CHANCE = 50 # 2% ADD_SKULL_EXISTING_REACTION_CHANCE = 20 # 5% -EMOJIS = dict( - CANDY="\N{CANDY}", - SKULL="\N{SKULL}", - MEDALS=( +EMOJIS = { + "CANDY": "\N{CANDY}", + "SKULL": "\N{SKULL}", + "MEDALS": ( "\N{FIRST PLACE MEDAL}", "\N{SECOND PLACE MEDAL}", "\N{THIRD PLACE MEDAL}", "\N{SPORTS MEDAL}", "\N{SPORTS MEDAL}", ), -) +} class CandyCollection(commands.Cog): @@ -69,7 +68,7 @@ class CandyCollection(commands.Cog): @in_month(Month.OCTOBER) @commands.Cog.listener() - async def on_reaction_add(self, reaction: discord.Reaction, user: Union[discord.User, discord.Member]) -> None: + async def on_reaction_add(self, reaction: discord.Reaction, user: discord.User | discord.Member) -> None: """Add/remove candies from a person if the reaction satisfies criteria.""" message = reaction.message # check to ensure the reactor is human @@ -140,7 +139,7 @@ class CandyCollection(commands.Cog): @staticmethod async def send_spook_msg( - author: discord.Member, channel: discord.TextChannel, candies: Union[str, int] + author: discord.Member, channel: discord.TextChannel, candies: str | int ) -> None: """Send a spooky message.""" e = discord.Embed(colour=author.colour) |