I have an array of type string populated by “bed time”, “sleepy”, and “I am tired”. Is it possible to pick apart a user’s input to find if any words are in the array?
For example: if user says “I am tired goodnight all”. I would like that to be a valid entry as it contains the phrase “I am tired”. Currently this is my code which works only for exact matches:
if(process.env.GN_MESSAGES.includes(message.toLowerCase())) {
"@alca, heya!"
client.say(channel, `gn ${tags.username}');
}