Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I get the last 1000 messages sent by a certain user?

I’ve tried channel.fetchMessages(), but the limit is 100 messages. It’s for a bot supposed to simulate users using machine learning.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The limit of returned messages is 100, with the default being 50. See the actual API docs for details.

By default, you get the most recent messages, but you can specify additional query criteria when fetching messages. You’ll need to repeat your fetch requests, adjusting the query criteria each time, in order to collect successively older messages. After each request, you can analyze what you’ve collected so far to determine if you need to keep fetching or not.

Beware of the rate limits.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading