This repository has been archived by the owner on Dec 26, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨ Adding message history #380
✨ Adding message history #380
Changes from 1 commit
d4041bd
cf273c5
a41829e
a88a31e
3d4a3e2
83f1d02
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
limit HAS to be capped to 100. If they choose a number too big there will be rate limits and that will cause it to stall because of an "invisible error"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree, we need to provide an user-friendly way to get all messages within a channel, even if it is extremely slow.
Discord.py do it has well, see
channel.history(limit=...).flatten()
Also it deal very nicely with ratelimiting.
I test it with
4000
messages, in41.18647676300316
secondsFor
8000
messages, it took84.87266815700423
secondsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point but you need to change things
There can be a lot of api calls so you should use gather. You can even use itertools.chain around gather. I bet that would be useful here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry on mobile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raw_messages
is not yet converted payload, so you cant access.id
, i guess we can do["id"]
thoThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would be bettr