simple discord.js bot question
hey, I have a bot for my NFL server and I wrote this script to ping a user who hates the player Trevor Lawrence anytime tlaw is mentioned. It will read a message for tlaw and ping the user, but for whatever reason capitalized t in Tlaw does not work -- I thought using the | | operator would work but it isn't, thoughts?
5 Replies
lol, I don't think you can do an
||
in .includes()
There's more compact ways, but it should work if you list it out individually, eg: message.content.includes('tlaw') || message.content.includes('Tlaw')
More compact ways I can think of are having an array of bannable words and checking if it's in the array, or some regex .match()
I'd have to look into the compact ways thoughthanks bae
or with one regex, case insensitive
and with a list, maybe this
you're bae now