[ENH] Send / Reply messages should consider rate limits #3
Labels
No labels
Automated
Backlog
Post_Prototype_1.0
Bot_Code
Core
Bot_Code
Custom
CI/CD
Complexity
Advanced
Complexity
Basic
Complexity
Expert
Complexity
Intermediate
Kind/Breaking
Kind/Bug
Kind/Bug Fix
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Nix
Ownership
Collab
Ownership
Collab with Leads
Ownership
Individual Lead
Ownership
In-Review
Ownership
Needs Owner > May Delegate
Ownership
Workshop with Leads
Phase 1.0
Requirements > Drafting
Phase 1.0
Requirements > Researching
Phase 1.0
Requirements > Review & Planning
Phase 2.0
Design > Research & Analysis
Phase 3.0
Coding > Implementation
Phase 4.0
QA > Unit Testing & Design
Phase 5.0
Resolution > Completed
Phase 5.0
Resolution > Review for Completion
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: modulatingforce/forcebot_rs#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Recently noticed that the bot got temporarily shadowbanned because it may have reached rate limits as described here
https://dev.twitch.tv/docs/irc/#rate-limits
To address this in the test bot, I added variables
ratelimittimer :bool
,ratelimitstart :Instant
,ratelimitcounter :i32
for at least covering a single reply testIdeally instead, both Reply & Say should be called only after rate limits are considered. For example, some function called first that helps determine if it will send the message or either queue it or not end it at all if the message will reach rate limits
Not a high priority at the moment as long as I have relatively controlled tests, and the current functionality using the above variables seem to work at the moment. However, the current implementation will likely get bulky if I have to define it for each method that is related to reply/say
One possible way to design this is maybe to have a function called that tracks these variables per channel, and outputs whether the rate is likely reached or not. If it has not been reached, the say/reply function can be executed
I developed a somewhat rudimentary one in
b1c2c2b099
I'm at least not facing any mutability/borrowing issues. lule and this is a bit simpler than code provided by tori, though also less robust than tori's
For now, considering this ready for review for completion . If there are further enhanced requirements in the future, I can create a new issue for that enhancement; if there are issues with the current rate limiters, I can
The Core Code behind
RateLimiter
continues to work, defined in https://git.flake.sh/modulatingforce/forcebot_rs/src/branch/main/src/core/ratelimiter.rsThere may be areas where the
RateLimiter
will be used, such as when aBotInstance
needs to determine whether to send a message or not, but these would be external from the code ofRateLimiter
If needed, I can either Enhance on the fly or add separate Issues to Enhance RateLimiter further
Considering this Issue Resolved