0

I am using this code to DM users based on keywords, and need to open it up to recognizing the trigger text in a message, and not just DMing when the message is only the trigger text

module.exports = (client, triggerText, replyText) => {
client.on('message', message => {
    if (message.content.toLowerCase() === triggerText.toLowerCase()){
        message.author.send(replyText)
    }
})

}

MrMythical
  • 7,595
  • 2
  • 12
  • 40
Wick
  • 1
  • 1
  • Yes, thank you. I was thinking there would be a simpler solution like message.content === vs message.content.includes, but this looks like it should work. – Wick Jan 30 '22 at 00:21

0 Answers0