diff --git a/constants.py b/constants.py index a0b2f64..0d863c5 100644 --- a/constants.py +++ b/constants.py @@ -24,6 +24,12 @@ SPONSORBLOCK_CATEGORY_NAMES = { "selfpromo": "self promotion", "sponsor": "sponsored", } +REACTIONS = { + "cat": ["🐈"], + "dog": ["🐕"], + "gn": ["💤", "😪", "😴", "🛌"], + "pizza": ["🍕"], +} RELOADABLE_MODULES = [ "arguments", "audio", diff --git a/fun.py b/fun.py index c55d841..8c2faa7 100644 --- a/fun.py +++ b/fun.py @@ -1,10 +1,13 @@ import random import commands +from constants import REACTIONS async def on_message(message): - if random.random() < 0.01 and "gn" in commands.tokenize( - message.content, remove_prefix=False - ): - await message.add_reaction(random.choice(["💤", "😪", "😴", "🛌"])) + if random.random() < 0.01: + tokens = commands.tokenize(message.content, remove_prefix=False) + for keyword, options in REACTIONS.items(): + if keyword in tokens: + await message.add_reaction(random.choice(options)) + break