diff options
Diffstat (limited to 'bot/seasons/halloween/spookyreact.py')
-rw-r--r-- | bot/seasons/halloween/spookyreact.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bot/seasons/halloween/spookyreact.py b/bot/seasons/halloween/spookyreact.py index 3b4e3fdf..f1dbb905 100644 --- a/bot/seasons/halloween/spookyreact.py +++ b/bot/seasons/halloween/spookyreact.py @@ -17,11 +17,8 @@ SPOOKY_TRIGGERS = { } -class SpookyReact(Cog): - - """ - A cog that makes the bot react to message triggers. - """ +class SpookyReact: + """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") |