diff options
| author | 2021-05-03 13:18:25 -0400 | |
|---|---|---|
| committer | 2021-05-03 13:18:25 -0400 | |
| commit | 5838d291ff56bac0aaf7a0cfc669c065ddda50b1 (patch) | |
| tree | a6b97ddcbc8fc755d98520cf3cde6e471db7dda0 /bot/exts/valentines/myvalenstate.py | |
| parent | fix: Resolve Merge Conflicts (diff) | |
chore: Clean Up the Valentines Season
- Change commands.Bot type hints to bot.Bot
- Remove the setting of Cog.bot if it isn't being used
- Change ctx.author -> ctx.message.author
Diffstat (limited to 'bot/exts/valentines/myvalenstate.py')
| -rw-r--r-- | bot/exts/valentines/myvalenstate.py | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/bot/exts/valentines/myvalenstate.py b/bot/exts/valentines/myvalenstate.py index 041af7af..19e6b57f 100644 --- a/bot/exts/valentines/myvalenstate.py +++ b/bot/exts/valentines/myvalenstate.py @@ -7,6 +7,7 @@ from random import choice  import discord  from discord.ext import commands +from bot.bot import Bot  from bot.constants import Colours  log = logging.getLogger(__name__) @@ -46,7 +47,7 @@ class MyValenstate(commands.Cog):          """Find the vacation spot(s) with the most matching characters to the invoking user."""          eq_chars = collections.defaultdict(int)          if name is None: -            author = ctx.message.author.name.lower().replace(' ', '') +            author = ctx.author.name.lower().replace(' ', '')          else:              author = name.lower().replace(' ', '') @@ -60,7 +61,7 @@ class MyValenstate(commands.Cog):          embed_title = "But there are more!"          if len(matches) > 1: -            leftovers = f"{', '.join(matches[:len(matches)-2])}, and {matches[len(matches)-1]}" +            leftovers = f"{', '.join(matches[:-2])}, and {matches[-1]}"              embed_text = f"You have {len(matches)} more matches, these being {leftovers}."          elif len(matches) == 1:              embed_title = "But there's another one!" @@ -81,6 +82,6 @@ class MyValenstate(commands.Cog):          await ctx.send(embed=embed) -def setup(bot: commands.Bot) -> None: +def setup(bot: Bot) -> None:      """Valenstate Cog load."""      bot.add_cog(MyValenstate(bot)) | 
