A sharder for the Discord.js library.
npm install discord-sharding- About
- Installation
- Usage
- Example
- Options
Discord-Sharding-Cluster is a fork of Eris Sharder, proposing a powerful sharding manager for the Discord.js library, using Node.js's cluster module to spread shards evenly among all cores.
All features are on-par with Eris Sharder, anything that gets added to Eris Sharder will get added here too.
With npm:
``bash`
$ npm install discord-sharding
$ pnpm install discord-sharding
In index.js:
`javascript
const { ShardingCluster } = require('discord-sharding');
const manager = new ShardingCluster('./src/bot.js', { token: 'your-token-goes-here' });
manager.on('clusterCreate', cluster => console.log(Launched cluster ${cluster.id}));
manager.spawn();
`
In bot.js
`javascript
const { Client } = require('discord-sharding');
const { Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
client.on('ready', () => console.log(Cluster ${client.cluster.id} is ready!));
client.login(); // no token is required here!
``