diff options
| author | 2021-08-07 05:23:03 +0300 | |
|---|---|---|
| committer | 2021-08-31 13:08:51 -0700 | |
| commit | 745cd1d6d3d6227d2a1e82cf25611d76221c40cd (patch) | |
| tree | 6d653668fe1bbfd237b4c87890e0c67a36e2c7f5 /bot/exts/valentines | |
| parent | Merge pull request #835 from python-discord/discord-2.0 (diff) | |
Fix type annotations
Diffstat (limited to 'bot/exts/valentines')
| -rw-r--r-- | bot/exts/valentines/be_my_valentine.py | 7 | ||||
| -rw-r--r-- | bot/exts/valentines/valentine_zodiac.py | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/bot/exts/valentines/be_my_valentine.py b/bot/exts/valentines/be_my_valentine.py index 8b522a72..c238027a 100644 --- a/bot/exts/valentines/be_my_valentine.py +++ b/bot/exts/valentines/be_my_valentine.py @@ -2,7 +2,6 @@ import logging import random from json import loads from pathlib import Path -from typing import Tuple import discord from discord.ext import commands @@ -146,7 +145,7 @@ class BeMyValentine(commands.Cog): else: await ctx.author.send(f"Your message has been sent to {user}") - def valentine_check(self, valentine_type: str) -> Tuple[str, str]: + def valentine_check(self, valentine_type: str) -> tuple[str, str]: """Return the appropriate Valentine type & title based on the invoking user's input.""" if valentine_type is None: return self.random_valentine() @@ -162,13 +161,13 @@ class BeMyValentine(commands.Cog): return valentine_type, "A message for" @staticmethod - def random_emoji() -> Tuple[str, str]: + def random_emoji() -> tuple[str, str]: """Return two random emoji from the module-defined constants.""" emoji_1 = random.choice(HEART_EMOJIS) emoji_2 = random.choice(HEART_EMOJIS) return emoji_1, emoji_2 - def random_valentine(self) -> Tuple[str, str]: + def random_valentine(self) -> tuple[str, str]: """Grabs a random poem or a compliment (any message).""" valentine_poem = random.choice(self.valentines["valentine_poems"]) valentine_compliment = random.choice(self.valentines["valentine_compliments"]) diff --git a/bot/exts/valentines/valentine_zodiac.py b/bot/exts/valentines/valentine_zodiac.py index d862ee63..339ea646 100644 --- a/bot/exts/valentines/valentine_zodiac.py +++ b/bot/exts/valentines/valentine_zodiac.py @@ -4,7 +4,7 @@ import logging import random from datetime import datetime from pathlib import Path -from typing import Tuple, Union +from typing import Union import discord from discord.ext import commands @@ -25,7 +25,7 @@ class ValentineZodiac(commands.Cog): self.zodiacs, self.zodiac_fact = self.load_comp_json() @staticmethod - def load_comp_json() -> Tuple[dict, dict]: + def load_comp_json() -> tuple[dict, dict]: """Load zodiac compatibility from static JSON resource.""" explanation_file = Path("bot/resources/valentines/zodiac_explanation.json") compatibility_file = Path("bot/resources/valentines/zodiac_compatibility.json") |