Calling a command from a sentence

Is there a way to call a command, if the command word is used in a sentance? For example someone in chat writes “Hi there lads” where “lads” is the command keyword. Is there a way to call the corresponding command to that?


This isn’t really possible. A Nightbot command, for example a counter command to track how many times a word has been said, will only trigger when the command name, presumably the word itself, is the first word in a message. The only way Nightbot will respond to a certain word found at any position in a message is with a timeout through its blacklisted words filter.

I was just thinking that nightbot is javascript based and it might support RegEx patterns to cancel out what’s in front and behind the keyword.

Edit: Nevermind after some testing with the String.contains() method and RegEx, it turns out it takes the entire command as a one single string so you can’t actually make it take a word from a sentence. That is, unless the developers implement it.

1 Like

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