Team in two words

How to make a team in two words?
For example: how are you
The bot replies: good

1 Like

Hey @Bublik!

Here’s the solution:

!addcom how $(eval q=decodeURIComponent(`$(querystring)`); q.includes(`are you`)?`Good`:` `;)

How do add multiple strings in includes, ie: Hello + all / everyone / everyone? Thanks

Hey @Miro!

I’m not sure I understand what you mean, if you want to have multiple tests done on q, use the logical operator || (OR).
For example:

!addcom hello $(eval q=decodeURIComponent(`$(querystring)`); q.includes(`all`)||q.includes(`everyone`)?`Hello $(user)`:` `;)

I’m afraid I can’t offer better assistance without a clearer explanation of what you want.

The message is too long

The command field is just the word that needs to trigger Nightbot, so you can just set that to “how”, put the $(eval ) part in the message field.

As xgerhard said, this is how to set up a command from the dashboard:


When you see !commands add or !addcom it’s the way to add it from the chat.

1 more question: I want the bot to answer the question for me and the audience. For example, the Viewer writes-hi (my nickname), the bot responds hi. The viewer writes-hi bot, bot replies-hi. But if the viewer writes just Hello, the bot should be silent. how do I prescribe it?

This should do the trick:

!addcom hi $(eval q=`$(query)`.toLowerCase(); q.includes(`YOUR_USERNAME_IN_LOWER_CASE`)||q.includes(`nightbot`)?`Hi $(user)`:` `;)

Just replace YOUR_USERNAME_IN_LOWER_CASE, for example Bublik should be bublik in the command.
And if you want to have the bot reply for hello and hey as well, feel free to update the command, or to use alias commands, like so:

!addcom hello -a=hi $(query)
!addcom hey -a=hi $(query)

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