Help in command !echo

Hi, I have a nightbot command called “!echo”, basically he repeats a message, the command is:

!echo $(query)

I would like to know if i can prevent the nightbot from giving his streamelements points through:

!echo !givepoints

I tried this:

$(eval ((String(decodeURIComponent($(query))).trim().toLowerCase().replace(/\s+/g, ‘’) == “!givepoints”) ? “Good try! LUL” : decodeURIComponent($(query))))

The problem is that this path only works if the viewer writes just “!givepoints” without anything after that, like the “@user” or the amount of points
I could just stop the nightbot from earning points in the streamelements, but I want to do something funny, is there a way for this to work?

Hiya, you probably want something like this:

`$(query)`.toLowercase().includes('!givepoints') ? 'Good try! LUL' : `$(query)` 

It worked, thank you very much! :smiley:

I’d actually recommend something like this

$(eval `$(1)`.split(``).join(` `).includes(`!`) ? `Good try! LUL` : `$(query)`)

Just to prevent them from using any stream elements commands. As I’m pretty sure there’s other commands than !givepoints that can give out points

1 Like

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