discord-sharding

1.0.1 • Public • Published

Discord.js Sharding Clusters

Discord node-current

Table of Contents

About

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.

Installation

With npm:

$ npm install discord-sharding
$ pnpm install discord-sharding

Usage

In index.js:

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

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!

Package Sidebar

Install

npm i discord-sharding

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

39.6 kB

Total Files

11

Last publish

Collaborators

  • navy_shooter