Apart from ShardingManager, discord.js also supports a sharding mode known as Internal sharding. Internal sharding creates multiple websocket connections from the same process, and does not require major code changes. To enable it, simply pass shards: 'auto' as ClientOptions to the Client constructor. However, internal sharding is not ideal for bigger bots due to high memory usage of the single main process and will not be further discussed in this guide.
Join the Discord to ask follow-up questions and connect with the community
Support server for discord.js, a Node.js module to interact with Discord's apps API.
57,666 Members
Join