How do I set commands with multiple words?

Asked Oct 7, 2021·3 replies·Last activity 4 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

Basically I'd like a command where anyone types "Hello there" in the chat and Nightbot replies with "General Kenobi!"
I understand Nightbot commands have to be one word to trigger but I read a response to an old thread that wasn't further explored or confirmed: (link expired)

I do not know how to code and barely understand code related jargon.

3 replies

Hiya, with $(evil) you can run custom code, so we can create a command that runs when someone types ‘hello’ and we will have to check the rest of the sentence inside the command:

js
!commands add hello $(eval `$(querystring)`.toLowerCase() == `there` ? `response here` : ` `)
Gerhard said:
``!commands add hello $(eval $(querystring).toLowerCase() == there ? response here : )``

This will only respond to exactly “Hello there” which if that’s to strict you could make a slight alteration to have it handle more situations like “Hello there!” Or “Hello there Streamer”

!addcom hello $(eval `$(querystring $(1))`.toLowerCase().includes(`there`)?`Response`:` `)

Oh this is super helpful! Thankyou for the help, I greatly appreciate it. <3