Nightbot custom command output

Hey everybody, I know the 5 second rule for the bot, but is that only if the custom command has an output?

I am wondering how does twitch handle when people join raffles by trying !raffle ? (I have seen channels doing such commands with more than one !raffle command each 5 seconds, so it must be doable)

Also is output required from a custom command? I cant just die() without a message or echo?

What I am trying to do is a command that will increase a counter each time it is called but without an output.

so each time somebody says: !bork
the bork counter goes up without the nightbot actually printing anything.

Anybody out there who has done something similar or a raffle ish command that can tell me that?

Thanks in advance

I have also seen other streams do the “mission” or “heist” commands, where one user starts a heist and then other people join it.

What I basically want is for people to use a command so I can add them to a list. (Without them having to wait 5 seconds)

You can make a command have no output by wrapping it in an $(eval) variable and then ending your code with " ", like this:

!commands add !bork $(eval counter = $(count); `$(query)` == "count" ? `Bork counter is ${counter}` : " ")
1 Like

I do commands in the nightbot command editor not by typing it in the tiwtch chat, so the format seems a bit different.

Can I do:
$(eval counter = $(customapi http://fakewebpage.com/fakescriptname.php?value=bork))

?

You can do

$(eval $(urlfetch http://fakewebpage.com/fakescriptname.php?value=bork); " ")

if that site will return a number. If not, you need to make it a string by doing

$(eval `$(urlfetch http://fakewebpage.com/fakescriptname.php?value=bork)`; " ")
1 Like

Thanks that solved the lack of output error I had.

Do you have any knowledge regarding the second part of my questions? (Since I can see that even with no output I am still limited to 5 second cooldown limit)

I don’t think Nightbot supports a command cooldown lower than 5 seconds.

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