Way to make a command work with a keyword

so if i wanted to make a command where someone says

are you a virgin?

then have the bot respond after it sees the word virgin

so basically, is there a way to have the command to activate whenever the word virgin appears anywhere in the sentence? or does virgin have to be in the beginning?

This is not possible with Nightbot. Commands can only be triggered by the first word in the message.

The best you can do is having several identical commands (or use aliases) with different trigger words (are, is, why, etc.).

!commands add are $(eval `$(query)`.toLowerCase().includes("virgin") ? "Reply here" : " ")

An alternative is to make “virgin” a blacklisted word in Spam Protection and make your message the custom message, but this would of course timeout the user for 5 seconds.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.