diff options
Diffstat (limited to 'bot/seasons/valentines/myvalenstate.py')
| -rw-r--r-- | bot/seasons/valentines/myvalenstate.py | 11 | 
1 files changed, 8 insertions, 3 deletions
diff --git a/bot/seasons/valentines/myvalenstate.py b/bot/seasons/valentines/myvalenstate.py index 7d9f3a59..344f52f6 100644 --- a/bot/seasons/valentines/myvalenstate.py +++ b/bot/seasons/valentines/myvalenstate.py @@ -16,13 +16,14 @@ with open(Path('bot', 'resources', 'valentines', 'valenstates.json'), 'r') as fi  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.Cog):      @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(commands.Cog):  def setup(bot): +    """Valenstate Cog load.""" +      bot.add_cog(MyValenstate(bot))      log.info("MyValenstate cog loaded")  |