Nighbot responding to a sentence / command name with space

How can i make nighbot reply to things like “whats up nighbot”. Whenever I just type it in as a command it doesn’t reply.

Hey @2twenty_one1!

A command name can only be one “word,” meaning there can’t be no space, so here you’d have to create a command called what's, check if the rest of the sentence contains Nightbot, and if the check matches, then send a response.

!addcom what's $(eval `$(query)`.toLowerCase().includes(`nightbot`)?`YOUR_RESPONSE`:` `)
1 Like

Can i do this with multiple words? Or is it one word and then if it contains the other word?

You can do this with full sentences if you’d like:

!addcom FIRST_WORD $(eval `$(query)`.toLowerCase().includes(`REST_OF_THE_SENTENCE_IN_LOWER_CASE`)?`YOUR_RESPONSE`:` `)

I just didn’t to add more flexibility, but it’s up to you.

1 Like

Ok thanks a lot i will use it!

1 Like

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