Comments (8)
Does code like this work fine for you?
from ackcord.
It looks like singleFuture
goes through the same code path, but let me try to refactor my code to use that pattern instead.
from ackcord.
Can't reproduce with a for loop, singleFuture
and withSideEffects
either.
Would be great if you could post the code that's causing this
from ackcord.
Sorry it's a bit dense, but it happens in this logic with creating reactions: https://github.com/jonathan-ostrander/music-quiz/blob/master/src/main/scala/dev/ostrander/musicquiz/actor/Game.scala#L148-L151
from ackcord.
I can confirm that rate limiting works when just sending messages, but I see the same behavior with this simplified example when sending both reactions and messages through singleIgnore
.
from ackcord.
Hmm, can you confirm that it's actually the fact that the rate limit is never released?
For the above example, it's very likely that it will fail for some of the messages if AckCord has no ratelimit info at all. This is usually the case just after the bot has started. What happens if you try the ratelimit command a second time? Does it work then?
If it does, and you need to send requests in rapid succession like this at the start of the bot's lifespan, take a look at Requests.RequestProperties.retry
from ackcord.
Here's an example debug log for the rate limiter for when this happens. It looks like it's updating/resetting the limits fine and then just stops all of a sudden. I can probably take a deeper look into what's going on. My suspicion is that maybe there's a response that doesn't include the reset info in the rate limit response?
from ackcord.
Ok, I think I found the issue and I think it's due to the non-relative TilReset
path. In one example I found where this was happening, the last headers that were received by my app for rate limits on the reaction path were
12:46:38.628 [AckCord-akka.actor.default-dispatcher-20] DEBUG akka.actor.typed.ActorSystem -
x-ratelimit-bucket: d6b7697c78814ecd72bb20df05517c78
x-ratelimit-limit: 1
x-ratelimit-remaining: 0
x-ratelimit-reset: 1596818798.567
x-ratelimit-reset-after: 0.001
That reset value corresponds to 12:46:38.567
which is before the call to System.currentTimeMillis()
so the value for tilReset
will be negative (since the system time is later than the reset time and isValid
will be false
so the updater is never called. Should be a simple fix.
from ackcord.
Related Issues (20)
- module not found: com.sedmelluq#lavaplayer;1.3.10 HOT 2
- [Suggestion?] A Higher-leveled /modular command framework for AckCord HOT 3
- [Suggestion?] A Higher-leveled /modular command framework for AckCord HOT 1
- Ban Reason does not get URL-Encoded HOT 1
- When a user send a message I want to reply to the message and send a DM HOT 1
- Removing a bot leads to an error parsing such message
- Weird exception logged for no reason HOT 3
- Error in stage Upstream producer failed with exception, removing from MergeHub now HOT 5
- ERROR: actor name [GatewayHandler] is not unique! HOT 2
- Member add/update events not being triggered HOT 4
- Avatar is incorrectly marked as not nullable for webhooks
- DecodingFailure at .t: Invalid message type
- user param doesn't work
- Autocomplete errors if the user doesn't enter anything
- Example not compiling HOT 1
- Components not being registered
- RawChannel has no entry in CacheTypeRegistry
- Mentionable is hardcoded to user
- Verifier IndexOutOfBoundsException issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ackcord.