I've noticed this only only works on exact matches, eg. "the" and "the" in both the message and the text file, I was wondering if there was any way to make the script detect a word that isn't separated by spaces in the message.

So, if I were to have "the" in the text file, and someone says "their" or "then" or something containing the word "the" if that could detected.

I would imagine the script would have to read the text file first, but I am unsure how to code that.