aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/easter
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/easter')
-rw-r--r--bot/exts/easter/bunny_name_generator.py6
-rw-r--r--bot/exts/easter/egg_decorating.py6
-rw-r--r--bot/exts/easter/egghead_quiz.py2
3 files changed, 7 insertions, 7 deletions
diff --git a/bot/exts/easter/bunny_name_generator.py b/bot/exts/easter/bunny_name_generator.py
index 3e97373f..4c3137de 100644
--- a/bot/exts/easter/bunny_name_generator.py
+++ b/bot/exts/easter/bunny_name_generator.py
@@ -3,7 +3,7 @@ import logging
import random
import re
from pathlib import Path
-from typing import List, Union
+from typing import Optional
from discord.ext import commands
@@ -18,7 +18,7 @@ class BunnyNameGenerator(commands.Cog):
"""Generate a random bunny name, or bunnify your Discord username!"""
@staticmethod
- def find_separators(displayname: str) -> Union[List[str], None]:
+ def find_separators(displayname: str) -> Optional[list[str]]:
"""Check if Discord name contains spaces so we can bunnify an individual word in the name."""
new_name = re.split(r"[_.\s]", displayname)
if displayname not in new_name:
@@ -26,7 +26,7 @@ class BunnyNameGenerator(commands.Cog):
return None
@staticmethod
- def find_vowels(displayname: str) -> str:
+ def find_vowels(displayname: str) -> Optional[str]:
"""
Finds vowels in the user's display name.
diff --git a/bot/exts/easter/egg_decorating.py b/bot/exts/easter/egg_decorating.py
index 6201d424..fb5701c4 100644
--- a/bot/exts/easter/egg_decorating.py
+++ b/bot/exts/easter/egg_decorating.py
@@ -4,7 +4,7 @@ import random
from contextlib import suppress
from io import BytesIO
from pathlib import Path
-from typing import Union
+from typing import Optional, Union
import discord
from PIL import Image
@@ -33,7 +33,7 @@ class EggDecorating(commands.Cog):
"""Decorate some easter eggs!"""
@staticmethod
- def replace_invalid(colour: str) -> Union[int, None]:
+ def replace_invalid(colour: str) -> Optional[int]:
"""Attempts to match with HTML or XKCD colour names, returning the int value."""
with suppress(KeyError):
return int(HTML_COLOURS[colour], 16)
@@ -44,7 +44,7 @@ class EggDecorating(commands.Cog):
@commands.command(aliases=("decorateegg",))
async def eggdecorate(
self, ctx: commands.Context, *colours: Union[discord.Colour, str]
- ) -> Union[Image.Image, None]:
+ ) -> Optional[Image.Image]:
"""
Picks a random egg design and decorates it using the given colours.
diff --git a/bot/exts/easter/egghead_quiz.py b/bot/exts/easter/egghead_quiz.py
index 7c4960cd..ad550567 100644
--- a/bot/exts/easter/egghead_quiz.py
+++ b/bot/exts/easter/egghead_quiz.py
@@ -31,7 +31,7 @@ TIMELIMIT = 30
class EggheadQuiz(commands.Cog):
"""This cog contains the command for the Easter quiz!"""
- def __init__(self) -> None:
+ def __init__(self):
self.quiz_messages = {}
@commands.command(aliases=("eggheadquiz", "easterquiz"))