aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Ritik Ranjan <[email protected]>2023-07-06 17:11:56 +0530
committerGravatar GitHub <[email protected]>2023-07-06 11:41:56 +0000
commitb9f27ede7879a446ce58f12ab89f5c7c67e744ae (patch)
tree81f3b45365f282aae616f228a101f590897ffe57
parentBump pillow from 9.5.0 to 10.0.0 (#1310) (diff)
Fix type hint (#1314)
-rw-r--r--bot/exts/utilities/colour.py2
-rw-r--r--bot/exts/utilities/epoch.py2
-rw-r--r--bot/utils/halloween/spookifications.py8
3 files changed, 6 insertions, 6 deletions
diff --git a/bot/exts/utilities/colour.py b/bot/exts/utilities/colour.py
index b8f1d62d..95f9ac22 100644
--- a/bot/exts/utilities/colour.py
+++ b/bot/exts/utilities/colour.py
@@ -182,7 +182,7 @@ class Colour(commands.Cog):
hex_tuple = ImageColor.getrgb(f"#{hex_colour}")
await self.send_colour_response(ctx, hex_tuple)
- def get_colour_conversions(self, rgb: tuple[int, int, int]) -> dict[str, str]:
+ def get_colour_conversions(self, rgb: tuple[int, int, int]) -> dict[str, tuple[int, ...] | str]:
"""Create a dictionary mapping of colour types and their values."""
colour_name = self._rgb_to_name(rgb)
if colour_name is None:
diff --git a/bot/exts/utilities/epoch.py b/bot/exts/utilities/epoch.py
index d1ba98bb..1f65b935 100644
--- a/bot/exts/utilities/epoch.py
+++ b/bot/exts/utilities/epoch.py
@@ -118,7 +118,7 @@ class TimestampMenuView(discord.ui.View):
self.dropdown.add_option(label=label, description=date_time)
@discord.ui.select(placeholder="Select the format of your timestamp")
- async def select_format(self, interaction: discord.Interaction, _: discord.ui.Select) -> discord.Message:
+ async def select_format(self, interaction: discord.Interaction, _: discord.ui.Select) -> None:
"""Drop down menu which contains a list of formats which discord timestamps can take."""
selected = interaction.data["values"][0]
if selected == "Epoch":
diff --git a/bot/utils/halloween/spookifications.py b/bot/utils/halloween/spookifications.py
index c45ef8dc..b0c139e6 100644
--- a/bot/utils/halloween/spookifications.py
+++ b/bot/utils/halloween/spookifications.py
@@ -6,7 +6,7 @@ from PIL import Image, ImageOps
log = logging.getLogger()
-def inversion(im: Image) -> Image:
+def inversion(im: Image.Image) -> Image.Image:
"""
Inverts the image.
@@ -17,7 +17,7 @@ def inversion(im: Image) -> Image:
return inv
-def pentagram(im: Image) -> Image:
+def pentagram(im: Image.Image) -> Image.Image:
"""Adds pentagram to the image."""
im = im.convert("RGB")
wt, ht = im.size
@@ -27,7 +27,7 @@ def pentagram(im: Image) -> Image:
return im
-def bat(im: Image) -> Image:
+def bat(im: Image.Image) -> Image.Image:
"""
Adds a bat silhoutte to the image.
@@ -49,7 +49,7 @@ def bat(im: Image) -> Image:
return im
-def get_random_effect(im: Image) -> Image:
+def get_random_effect(im: Image.Image) -> Image.Image:
"""Randomly selects and applies an effect."""
effects = [inversion, pentagram, bat]
effect = choice(effects)