DeepBlue/cogs/fun/reactions.py

42 lines
1.2 KiB
Python
Raw Normal View History

2020-01-08 01:26:36 +00:00
'''
Listens to keywords in messages and
reacts accordingly
'''
2020-01-08 00:11:50 +00:00
import discord
from discord.ext import commands
class Reactions(commands.Cog):
2020-01-08 01:26:36 +00:00
def __init__(self, client: discord.Client):
2020-01-08 00:11:50 +00:00
self.client = client
@commands.Cog.listener()
2020-01-08 01:26:36 +00:00
async def on_message(self, message: discord.Message):
2020-01-08 00:11:50 +00:00
if message.author.bot:
return
2020-01-08 01:26:36 +00:00
# Flags
2020-01-08 00:11:50 +00:00
if "canada" in message.content.lower():
await message.add_reaction("🇨🇦")
if "germany" in message.content.lower():
await message.add_reaction("🇩🇪")
if "uk" in message.content.lower() or "britain" in message.content.lower():
await message.add_reaction("🇬🇧")
if "china" in message.content.lower():
await message.add_reaction("🇨🇳")
if "america" in message.content.lower() or " usa" in message.content.lower():
await message.add_reaction("🇬")
await message.add_reaction("🇦")
await message.add_reaction("🇾")
2020-01-08 01:26:36 +00:00
if "extremejoy" in message.content.lower():
await message.add_reaction("<:extremejoy:612424729969819648>")
2020-01-08 00:11:50 +00:00
2020-01-08 01:26:36 +00:00
def setup(client: discord.Client):
2020-01-08 00:11:50 +00:00
client.add_cog(Reactions(client))