$(customapi url) not responding fast enough (not a server side issue)

I have written a small API for use in Nightbot in the customapi command that doesn’t seem to work a large percentage of the time.

This command:

 !addme =>  $(customapi http://XXX.com/NightQueue.php?command=addme&user=$(user))

This API will return the text: “$(user) has been added to the queue”

This should be able to be used by everyone but often is not executed by everyone. It appears to work “slowly” or just at random intervals. Although it does seem like it responds to me, more often than the viewers.
The api if accessed directly works very fast and reliably, and showing the access logs on my server, I can see that Nightbot never sent the requests that didn’t get executed by nightbot.
It does work some of the time but maybe only 30% of the time for my viewers. It seems to work best if they use it slowly, maybe once per minute or a little less.

Is there some kind of limit on the number of API calls per minute Nightbot can make or something? I only had about 10 viewers in my stream and I think only 4-5 or so were actually at their keyboard and attempted the “!addme” command. It would normally work for the first person and then if anyone else tried it they would get no response from Nightbot, then if I tried it it would almost always work.

Nightbot has a command cooldown on all commands. If your chatters post the same command in rapid succession it will not work. The cooldown is near zero for mods and the broadcaster. Also custom api commands do take longer to process, because they call an external API.

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