Twitch Chat (from a Twitch Dev)

Our code to deal with abuse (rate-limiting, etc) is subject to change periodically, but we should definitely have some better docs. I think it may be useful for us create a github chat docs repository specifically focused on the chat API. Twitch can push changes, but most importantly, you all can send pull-requests and/or issue reports to help us determine when the docs aren’t correct or vague.

The 20/100 message rate-limit is per connection, but the determination of whether 20 or 100 is used is per-message. Consider the case where a mod of channel ‘test’ sends 21 messages to room #test in 21 seconds. Since they are a mod on channel ‘test’, this will be allowed (100 message rate-limit). However, if their 21st message was instead to a different room ‘not_a_mod_room’ where the user is not a mod, their connection will have 21 messages (over the 20 limit for this particular message) and they will be IP banned. This is an artifact of this code originally being written with the assumption that connections only joined a single room, but its good to note this case for bots managing multiple rooms.

Regarding the JOINs being rate-limited, both authentication and JOINs are rate-limited together. A single IP is currently allowed only 50 JOIN/auths every 10s and if this limit is exceeded, you will be disconnected. This does not apply the 8h lockout.

There is currently no connection limit, but we plan on adding this.

1 Like