diff options
Diffstat (limited to 'bot/seasons/halloween/spookyreact.py')
| -rw-r--r-- | bot/seasons/halloween/spookyreact.py | 11 | 
1 files changed, 6 insertions, 5 deletions
| diff --git a/bot/seasons/halloween/spookyreact.py b/bot/seasons/halloween/spookyreact.py index 3b4e3fdf..9b14507a 100644 --- a/bot/seasons/halloween/spookyreact.py +++ b/bot/seasons/halloween/spookyreact.py @@ -18,10 +18,7 @@ SPOOKY_TRIGGERS = {  class SpookyReact(Cog): - -    """ -    A cog that makes the bot react to message triggers. -    """ +    """A cog that makes the bot react to message triggers."""      def __init__(self, bot):          self.bot = bot @@ -29,12 +26,13 @@ class SpookyReact(Cog):      @Cog.listener()      async def on_message(self, ctx: discord.Message):          """ -        A command to send the seasonalbot github project +        A command to send the seasonalbot github project.          Lines that begin with the bot's command prefix are ignored          Seasonalbot's own messages are ignored          """ +          for trigger in SPOOKY_TRIGGERS.keys():              trigger_test = re.search(SPOOKY_TRIGGERS[trigger][0], ctx.content.lower())              if trigger_test: @@ -54,6 +52,7 @@ class SpookyReact(Cog):            * author is the bot            * prefix is not None          """ +          # Check for self reaction          if ctx.author == self.bot.user:              logging.debug(f"Ignoring reactions on self message. Message ID: {ctx.id}") @@ -70,5 +69,7 @@ class SpookyReact(Cog):  def setup(bot): +    """Spooky reaction Cog load.""" +      bot.add_cog(SpookyReact(bot))      log.info("SpookyReact cog loaded") | 
