I have a bot that I made that allows users to request IDs to their custom levels for a certain game. The bot is running on the streamer’s computer while they’re streaming. This means that the IP the IRC server has is the streamer’s IP. I have a setting on the bot that allows the streamer to set a max level ID count for the queue so there can only be X IDs in the queue at once. What happens when someone tries to put in an ID if the queue is full is the bot tells them the queue is full. I’ve had a case where someone had 100+ viewers and they were all spamming their IDs and the streamer got IP banned from speaking in all Twitch chats for 2 hours. I want to fix this while still letting users know if the queue is full or not. How would I do this with little delay? Would whispering bypass the spamming filter?
PS: This is my first real bot that I’ve made so I don’t know a whole lot about how the Twitch chat system works.
There are limits in place.
What I do on my bots is whenever a command is sent in chat, the trigger sets a variable to a decaying value and checks if there is a value set to the same variable. If the variable has a value it stops executing. If it has no value it sets it to a value of 10 decaying 1 every second. This prevents the same command from being used more than once every ten seconds. Depending on the language you are using, you can do something similar.
All or most of the commands the bot does should use the same check, on the same variable.
In addition to implementing a spam protection based on the mentioned limits (and possibly modding the bot if possible), you could also try to group responses together if commands are executed in rapid succession. For example if a lot of the spam comes from responding with “Queue is currently full”, then you could wait a few seconds with the answer and answer to several people at once (but don’t wait too long or else people may think the bot doesn’t work). You can either only do this when you reach your spam protection, or just do it always so that it reduces chat spam a bit.
Whispering bypasses that spam filter, although it has it’s own spam detection, which can often causes issues for bots if they whisper a lot of people, mostly with similiar messages. I don’t have a lot of experience with that, although it can certainly be useful to reduce chat spam. Also take into account that some people have receiving whispers of people they don’t follow disabled or might not realize that the response came as a whisper.
Sounds like the thing you describe is not best done via Twitch Chat.
Since as you’ve already found it’s VERY easy to hit either the rate limits of chat and/or the rate limits of the API of the game you are getting the levels for.
In summary, don’t do it via Twitch Chat.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.