Direct Message Rate Limit

direct-messages

#1

Hello there.

I’m building a direct message bot and having concerns about how the rate limit would affect the user experience of using the direct message bot I’ve built.

I would like to understand the meaning of the passage below, written in the developer’s page regarding to direct message API usage (https://developer.twitter.com/en/docs/direct-messages/sending-and-receiving/api-reference/new-event):


When a message is received from a user you may send up to 5 messages in response within a 24 hour window.
Each message received resets the 24 hour window and the 5 allotted messages. Sending a 6th message within a 24 hour window or sending a message outside of a 24 hour window will count towards rate-limiting.


Let’s consider below scenario:

1.) Currently I have 1000 request left.
2.) A user sent me a direct message (whether through quick reply button or through text).

if:
a.) I send 5 direct messages as a response to the user, Would I have: 1000 request left, 999 request left, or 995 request left?
b.) I send 8 direct messages as a response to the user. Would I have: 999 request left, 997 request left, 996 request left, or 992 request left?

If scenario (a)'s answer is “1000 request left”, that means I don’t have to use my quota to reply to the user as long as I send only a maximum of 5 messages.

If scenario (a)'s answer is “999 request left”, that means I would use at least 1 of my allotted request quota to reply to the user.

Is my interpretation of the rule correct? Thank you.