Hello, I just recently learned about Nightbot and I understand very poorly. How can I make the bot respond also to a word in a sentence, and not just to a single word in chat.
For example, if there are extra words near the command, then the bot no longer responds to the command. Thank you.
Hey @hfpheibkbcfvb!
Please use the search bar before opening a new topic:
If you want the bot to no longer answer when there’s words after the command call, simply switch the logic:
!addcom FIRST_WORD $(eval `$(query)`.toLowerCase().includes(`REST_OF_THE_SENTENCE_IN_LOWER_CASE`)?`YOUR_RESPONSE`:` `)
becomes:
!addcom FIRST_WORD $(eval !`$(query)`.toLowerCase().includes(`REST_OF_THE_SENTENCE_IN_LOWER_CASE`)?`YOUR_RESPONSE`:` `)
or:
!addcom FIRST_WORD $(eval `$(query)`.toLowerCase().includes(`REST_OF_THE_SENTENCE_IN_LOWER_CASE`)?` `:`YOUR_RESPONSE`)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.