diff --git a/main.py b/main.py index 49ffedb..832d0ac 100644 --- a/main.py +++ b/main.py @@ -115,6 +115,16 @@ async def on_ready(): print("------") +@bot.event +async def on_message(message): + msg = message.content.lower() + for emoji, keywords in opt.msg_reacts.items(): + if any([keyword in msg for keyword in keywords]): + await message.add_reaction(discord.utils.find(lambda x: x.id == emoji, bot.emojis)) + + await bot.process_commands(message) + + # --- Tasks --- @tasks.loop(minutes=5) diff --git a/templates/data/options.py b/templates/data/options.py index a704c07..6fe15b7 100644 --- a/templates/data/options.py +++ b/templates/data/options.py @@ -31,3 +31,7 @@ exts = ['ae7q', 'base', 'fun', 'grid', 'ham', 'image', 'lookup', 'morse', 'qrz', # The text to put in the "playing" status. game = 'with lids on 7.200' + +# Emoji IDs and keywords for emoji reactions +# Use the format {emoji_id (int): ('tuple', 'of', 'lowercase', 'keywords')} +msg_reacts = {}