port 4000 on cluster
so my bot is in more than 8k servers and it requires clustering so when i start the bot
i get this Error: listen EADDRINUSE: address already in use :::4000
i dont want to use any ports at all
Solution:Jump to solution
In your API options in client options set automaticallyConnect to false and then in some event like ready or similar start it just once and on one shard by calling
client.server.start
2 Replies
Solution
In your API options in client options set automaticallyConnect to false and then in some event like ready or similar start it just once and on one shard by calling
client.server.start
I wrote a guide page for this topic now https://www.sapphirejs.dev/docs/Guide/plugins/API/starting-on-single-cluster-or-shard
Sapphire Framework
Starting on a single cluster or shard | Sapphire
Once your bot grows to a lot of servers, you will want to implement sharding, process clustering, or another form of