Nightbot response to chats phrases

A streamer I mod for wants a command set up to where when somebody says a specific name, nightbot responds with a phrase.
for example:

Viewer: :“blah blah blah Charlie.”
Nightbot: “you must donate such and such amount of money before I answer that question.”

Hey @wasonjar!

If you want Nightbot to detect a specific word that could be anywhere in a sentence, this isn’t possible.
If you want Nightbot to detect a specific sentence, you can do so like this:

!addcom FIRST_WORD_OF_THE_SENTENCE $(eval `$(query)`.includes(`REST_OF_THE_SENTENCE`)?`RESPONSE`:` `;)
1 Like

Thank you. This worked perfectly.
The only issue i had was you entered an extra : at the end but it was an easy fix.

1 Like

Oh, my bad, it was meant to be a ; (semi-colon)…
Same key, I must have been pressing Shift.


Can i add some how to response message the name of user that i response to ?

I mean if “someone” write in chat “Hello” the Nightbot will response “Hello @someone

@constafun Heya,

!addcom -cd=5 hello Hello @$(user)



what the meaning of “-cd=5” ?

@constafun That’s cooldown, by default adding commands via YouTube Live chat cooldown will be of 30 seconds. 5 seconds is minimum cool down you can set.


1 Like

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