Paging Discord Channel messages

Issue:

Hey yall, I’ve been trying to figure this out today a few different ways but cant seem to get it to work. I need to pull down all the messages in a certain discord channel and the API has a 100 item page-limit. I tried both a custom workflow using the HTTP module and some pagination looping to no avail (it’s close, just not perfect, linked below) as well as using the prebuilt discord node but when I select “Get Many” it throws a rate-limit error.

Would love some feedback on this on how I can paginate through all the pages of returned messages, thanks!

What is the error message (if any)?

ERROR: You are being rate limited.

Please share your workflow

Information on your n8n setup

  • n8n version: 1.20.0
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): DigitalOcean Docker 20.10.21
  • Operating system: Ubuntu 22.04

Hi @datalytyks, this sounds like you just have to add additional wait times between each request. Discord will communicate the rate limits through special headers (discord-api-docs/docs/topics/Rate_Limits.md at main · discord/discord-api-docs · GitHub) so you’d have to evaluate these in your workflow.

I think something like below should do the job:

(I’ve created this example using [email protected], so you might need to update your n8n instance before being able to import this workflow).

Hope this helps!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.