diff options
| author | 2021-09-01 18:32:55 -0700 | |
|---|---|---|
| committer | 2021-09-01 18:32:55 -0700 | |
| commit | f4e5e3850c9a030e0125a908dc5a8dbbcd6659dd (patch) | |
| tree | b92170615ddc59ba2571c01030fa9319001d9e93 /bot/exts/easter/egg_decorating.py | |
| parent | Fix type annotations (diff) | |
Union item with None to Optional with item.
Diffstat (limited to 'bot/exts/easter/egg_decorating.py')
| -rw-r--r-- | bot/exts/easter/egg_decorating.py | 6 |
1 files changed, 3 insertions, 3 deletions
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. |