diff options
Diffstat (limited to 'bot/exts/evergreen/fun.py')
| -rw-r--r-- | bot/exts/evergreen/fun.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bot/exts/evergreen/fun.py b/bot/exts/evergreen/fun.py index 63450025..4bbfe859 100644 --- a/bot/exts/evergreen/fun.py +++ b/bot/exts/evergreen/fun.py @@ -2,8 +2,9 @@ import functools import json import logging import random +from collections.abc import Iterable from pathlib import Path -from typing import Callable, Iterable, Tuple, Union +from typing import Callable, Optional, Union from discord import Embed, Message from discord.ext import commands @@ -53,7 +54,7 @@ def caesar_cipher(text: str, offset: int) -> Iterable[str]: class Fun(Cog): """A collection of general commands for fun.""" - def __init__(self, bot: Bot) -> None: + def __init__(self, bot: Bot): self.bot = bot self._caesar_cipher_embed = json.loads(Path("bot/resources/evergreen/caesar_info.json").read_text("UTF-8")) @@ -182,7 +183,7 @@ class Fun(Cog): await self._caesar_cipher(ctx, offset, msg, left_shift=True) @staticmethod - async def _get_text_and_embed(ctx: Context, text: str) -> Tuple[str, Union[Embed, None]]: + async def _get_text_and_embed(ctx: Context, text: str) -> tuple[str, Optional[Embed]]: """ Attempts to extract the text and embed from a possible link to a discord Message. @@ -191,7 +192,7 @@ class Fun(Cog): Returns a tuple of: str: If `text` is a valid discord Message, the contents of the message, else `text`. - Union[Embed, None]: The embed if found in the valid Message, else None + Optional[Embed]: The embed if found in the valid Message, else None """ embed = None |