aboutsummaryrefslogtreecommitdiffstats
path: root/bot/cogs/spookyreact.py
diff options
context:
space:
mode:
authorGravatar hundredrab <[email protected]>2018-10-11 01:40:26 +0530
committerGravatar hundredrab <[email protected]>2018-10-11 01:40:26 +0530
commit1ce65cf745d409550f36fa774825866c98d36cfe (patch)
treefffc2ec7fe0c9795a0e3296dbc986c6e93326b04 /bot/cogs/spookyreact.py
parentMerge pull request #34 from markylon/master (diff)
Fix #27: Add spooky reactions.
Diffstat (limited to 'bot/cogs/spookyreact.py')
-rw-r--r--bot/cogs/spookyreact.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/bot/cogs/spookyreact.py b/bot/cogs/spookyreact.py
new file mode 100644
index 00000000..1afdb196
--- /dev/null
+++ b/bot/cogs/spookyreact.py
@@ -0,0 +1,32 @@
+from discord.ext import commands
+
+SPOOKY_TRIGGERS = {
+ 'spooky': "\U0001F47B",
+ 'skeleton': "\U0001F480",
+ 'doot': "\U0001F480",
+ 'pumpkin': "\U0001F383",
+ 'halloween': "\U0001F383",
+ 'jack-o-lantern': "\U0001F383"
+}
+
+
+class SpookyReact:
+
+ """
+ A cog that makes the bot react to message triggers.
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+
+ async def on_message(self, ctx):
+ """
+ A command to send the hacktoberbot github project
+ """
+ for trigger in SPOOKY_TRIGGERS.keys():
+ if trigger in ctx.content.lower():
+ await ctx.add_reaction(SPOOKY_TRIGGERS[trigger])
+
+
+def setup(bot):
+ bot.add_cog(SpookyReact(bot))