diff --git a/src/kwaylon/jokes/helpers.py b/src/kwaylon/jokes/helpers.py
index 82b216c..6d3b1dd 100644
--- a/src/kwaylon/jokes/helpers.py
+++ b/src/kwaylon/jokes/helpers.py
@@ -5,6 +5,12 @@ from bs4 import BeautifulSoup
pattern = 'NP: {
?*}'
cp = nltk.RegexpParser(pattern)
+WORDS = set(w.lower() for w in nltk.corpus.words.words())
+
+
+def valid_word(word: str):
+ return word.strip().lower() in WORDS
+
def get_stock_price(symbol: str):
soup = BeautifulSoup(requests.get(f'https://finance.yahoo.com/quote/{symbol}').content, 'lxml')
diff --git a/src/kwaylon/jokes/jokes.py b/src/kwaylon/jokes/jokes.py
index cc855b1..98240a1 100644
--- a/src/kwaylon/jokes/jokes.py
+++ b/src/kwaylon/jokes/jokes.py
@@ -153,7 +153,8 @@ class Jaccuse(base.Joke):
class GoodBot(base.Joke):
@property
def regex(self) -> re.Pattern:
- return re.compile('(\w+) bot', re.IGNORECASE)
+ return re.compile('(\w+) bot$', re.IGNORECASE)
async def respond(self, message: Message, client: Client, match: re.Match):
- await message.add_reaction(utils.get(client.emojis, name='kaylon'))
+ if helpers.valid_word(match.group(1)):
+ await message.add_reaction(utils.get(client.emojis, name='kaylon'))