aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/valentines
diff options
context:
space:
mode:
authorGravatar Xithrius <[email protected]>2021-09-03 00:31:12 -0700
committerGravatar GitHub <[email protected]>2021-09-03 00:31:12 -0700
commitea47bc617e558929bcee39e6008a57d6dd814aa1 (patch)
treec40e2f23e55119fb33f83271d227103cb9be7c6f /bot/exts/valentines
parentImproved consistency for codeblocks to end with a newline (diff)
parentMerge pull request #802 from python-discord/decorator-factory/typehints-fix (diff)
Merge branch 'main' into android-codeblock-fix
Diffstat (limited to 'bot/exts/valentines')
-rw-r--r--bot/exts/valentines/be_my_valentine.py7
-rw-r--r--bot/exts/valentines/valentine_zodiac.py4
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 2a9069b1..243f156e 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")