aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/easter/egg_decorating.py
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2021-09-03 16:28:04 +0100
committerGravatar GitHub <[email protected]>2021-09-03 16:28:04 +0100
commitcd7060835b5b0d150c6e91d75bc3227ee43db0ba (patch)
tree4264ddbb25e86184255574cfd0e8fa9bb11d7bcb /bot/exts/easter/egg_decorating.py
parentHandle status not found with 404 picture (diff)
parentMerge pull request #839 from python-discord/android-codeblock-fix (diff)
Merge branch 'main' into teapot-support
Diffstat (limited to 'bot/exts/easter/egg_decorating.py')
-rw-r--r--bot/exts/easter/egg_decorating.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/exts/easter/egg_decorating.py b/bot/exts/easter/egg_decorating.py
index fd7620d4..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.
@@ -108,7 +108,7 @@ class EggDecorating(commands.Cog):
description="Here is your pretty little egg. Hope you like it!"
)
embed.set_image(url="attachment://egg.png")
- embed.set_footer(text=f"Made by {ctx.author.display_name}", icon_url=ctx.author.avatar_url)
+ embed.set_footer(text=f"Made by {ctx.author.display_name}", icon_url=ctx.author.display_avatar.url)
await ctx.send(file=file, embed=embed)
return new_im