aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons/valentines/myvalenstate.py
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2019-09-30 14:48:49 +0200
committerGravatar GitHub <[email protected]>2019-09-30 14:48:49 +0200
commit6120f9d90272cab33aa1da857dbfaeb1b5adbd9a (patch)
tree740c8bd789e24ca22913caad26bcd5897cd6d270 /bot/seasons/valentines/myvalenstate.py
parentEdit dates (diff)
parentMerge pull request #276 from python-discord/update-flake8-annotations (diff)
Merge branch 'master' into date-fix
Diffstat (limited to 'bot/seasons/valentines/myvalenstate.py')
-rw-r--r--bot/seasons/valentines/myvalenstate.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/seasons/valentines/myvalenstate.py b/bot/seasons/valentines/myvalenstate.py
index fad202e3..0256c39a 100644
--- a/bot/seasons/valentines/myvalenstate.py
+++ b/bot/seasons/valentines/myvalenstate.py
@@ -18,10 +18,10 @@ with open(Path("bot/resources/valentines/valenstates.json"), "r") as file:
class MyValenstate(commands.Cog):
"""A Cog to find your most likely Valentine's vacation destination."""
- def __init__(self, bot):
+ def __init__(self, bot: commands.Bot):
self.bot = bot
- def levenshtein(self, source, goal):
+ def levenshtein(self, source: str, goal: str) -> int:
"""Calculates the Levenshtein Distance between source and goal."""
if len(source) < len(goal):
return self.levenshtein(goal, source)
@@ -42,7 +42,7 @@ class MyValenstate(commands.Cog):
return pre_row[-1]
@commands.command()
- async def myvalenstate(self, ctx, *, name=None):
+ async def myvalenstate(self, ctx: commands.Context, *, name: str = None) -> None:
"""Find the vacation spot(s) with the most matching characters to the invoking user."""
eq_chars = collections.defaultdict(int)
if name is None:
@@ -81,7 +81,7 @@ class MyValenstate(commands.Cog):
await ctx.channel.send(embed=embed)
-def setup(bot):
+def setup(bot: commands.Bot) -> None:
"""Valenstate Cog load."""
bot.add_cog(MyValenstate(bot))
log.info("MyValenstate cog loaded")