NightDev Community Forums

Excluding greeting streamer

How do I make the bot stop responding when the streamer says ‘hello’?

Remove any commands that starts with “hello” so Nightbot won’t respond to it.

Can you react when you speak only to the viewer, not the streamer?

Hey @califa2736!

You can prevent the bot from answering the streamer messages this way:

$(eval `$(user)`.toLowerCase()==`$(channel)`?` `:`Hello!`)
1 Like

Thank you very much!

1 Like

Can I apply it like this?

!addcom hello -cd=5 $(twitch $(user) “{{displayName}}”) 님 $(eval a=[“welcome~”, “hi~”, “hello~”];a[Math.floor(Math.random() * a.length)]) $(eval $(user)==$(channel)? :Hello,welcome,hi)

You don’t need to use $(twitch $(user) "{{displayName}}"), $(user) gives you the same result.

Right now, if I said “hello” in your chat, the response would be:

EmilyPerrimon 님 welcome~/hi~/hello~ Hello,welcome,hi

You have to combine the bit of code I gave earlier with your array if you want to have a randomly picked answer:

$(eval a=[`welcome~`, `hi~`, `hello~`]; `$(user)`.toLowerCase()==`$(channel)`?` `:`$(user) 님 ${a[Math.floor(Math.random()*a.length)]}`)

master, dobby is free! ty :smiley: so much!

1 Like