Bot Preformance - Sending the same message to many servers
My bot sends he same message to many servers (nearly 1,600) at once.
The message includes:
- Embed
- Content (Role mentions)
- Attachment
At the moment, the bot sends the message with the attachment in our server, copies the attachment's URL then sends it to all servers.
My question is if that waiting for the message to be sent in our server is necessary or if we can rather just send the attachment to all servers to make it faster
4 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Users can tweak a few things anout the message to personalize it for their server. That's why an announcement channel wouldn't work in thi case.
The embed is the same, the message content is different per server
When a few of these messages come at once, it takes nearly 40 seconds for them to be sent in our sever.
Is there a way to shorten the time it takes to send it in our server?
I understand that if a bot is verified, the rate limit is more flexible, isn't it?
Rather weird, because it says that the rate limit is 10,000 in 10 minutes.
I know for a fact taht we sent much more than that many times already, around 50 and even 100 thousand.
Ratelimits are dynamically assigned by the API based on current load and may change at any point.
- The scale from okay to API-spam is sliding and depends heavily on the action you are taking
- Rainbow roles, clock and counter channels, and DM'ing advertisements to all members are all examples of things that are not okay
As Qjuh already mentioned you could create a webhook in each server (using the bot). Each webhook has their own limits so you can send your messages faster. If you create them using your bot you can still use buttons and respond to them. You can also modify the picture and name of the webhook, so it looks almost identical.