Skip to content

Get entire message history from channel #2431

Discussion options

You must be logged in to vote

If you're using the default event manager and this code is running in an event (which it is as I see you referencing event) then when you call .get() you're blocking the thread which the WebSocket uses to send and receive data from discord. This is why the WebSocket ends up complaining about missing heartbeats. You've prevented the WebSocket from processing anything by blocking!

The .get() method is a blocking method that means "Block the current thread until the asynchronous process is complete. You are asking for 10000 messages which means you're making 100 requests to discord (10000/100 = 100). This is far above the ratelimit, so JDA is waiting a certain amount of time before sending a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DV8FromTheWorld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants