diff options
Diffstat (limited to 'bot/seasons/valentines/myvalenstate.py')
| -rw-r--r-- | bot/seasons/valentines/myvalenstate.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/bot/seasons/valentines/myvalenstate.py b/bot/seasons/valentines/myvalenstate.py index 9f06553d..344f52f6 100644 --- a/bot/seasons/valentines/myvalenstate.py +++ b/bot/seasons/valentines/myvalenstate.py @@ -15,14 +15,15 @@ with open(Path('bot', 'resources', 'valentines', 'valenstates.json'), 'r') as fi STATES = json.load(file) -class MyValenstate: +class MyValenstate(commands.Cog): + """A Cog to find your most likely Valentine's vacation destination.""" + def __init__(self, bot): self.bot = bot def levenshtein(self, source, goal): - """ - Calculates the Levenshtein Distance between source and goal. - """ + """Calculates the Levenshtein Distance between source and goal.""" + if len(source) < len(goal): return self.levenshtein(goal, source) if len(source) == 0: @@ -43,6 +44,8 @@ class MyValenstate: @commands.command() async def myvalenstate(self, ctx, *, name=None): + """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(' ', '') @@ -81,5 +84,7 @@ class MyValenstate: def setup(bot): + """Valenstate Cog load.""" + bot.add_cog(MyValenstate(bot)) - log.debug("MyValenstate cog loaded") + log.info("MyValenstate cog loaded") |