-
Right now we have a express server where we also included discord.js code, the problem is when there's a
Multiple welcome messages are being sent for only one member joining the server, What's the solution for this? The event guildMemberAdd should be delivered exactly once irrespective on number of clients that i have. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
To horizontally scale a Discord bot within a server, you need to use a Sharding Manager, more information in the guide. As for scaling it across different servers... that's a lot trickier and I don't know a sharder that does this. Not really related to the issue at hand but... within the same server, you can alternative do any of the following:
Generally speaking, discord.js is fine in a single process even if you're at 10k guilds, so if your bot is below that, you should not need to do this. Also, it's not recommended to shard below 1k guilds as it wastes your daily |
Beta Was this translation helpful? Give feedback.
To horizontally scale a Discord bot within a server, you need to use a Sharding Manager, more information in the guide.
As for scaling it across different servers... that's a lot trickier and I don't know a sharder that does this.
Not really related to the issue at hand but... within the same server, you can alternative do any of the following:
fastify
has a plugin calledfastify-piscina
which supports worker threads, which are more efficient than separate processes as they share information quicker and share the same memory.Generally speaking, discord.js…