Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrgriefs/discord.js-cluster
A sharder for the Discord.js library
https://github.com/mrgriefs/discord.js-cluster
cluster clustering discord discordjs javascript manager shard sharding
Last synced: 4 months ago
JSON representation
A sharder for the Discord.js library
- Host: GitHub
- URL: https://github.com/mrgriefs/discord.js-cluster
- Owner: MrGriefs
- License: mit
- Created: 2021-06-27T20:29:21.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-17T09:03:43.000Z (about 2 years ago)
- Last Synced: 2024-10-12T03:20:44.460Z (4 months ago)
- Topics: cluster, clustering, discord, discordjs, javascript, manager, shard, sharding
- Language: JavaScript
- Homepage:
- Size: 1.86 MB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Discord.js Sharder
## Table of Contents
- [About](#about)
- [Installation](#installation)
- [Usage](#usage)
- [Documentation](#documentation)## About
discord.js-cluster is a powerful cluster manager for the [Discord.js](https://discord.js.org/) library which implements [multiprocessing](https://en.wikipedia.org/wiki/Multicore_programming) to increase the performance of your client, heavily inspired by the Discord.js built-in [ShardingManager](https://discord.js.org/#/docs/main/stable/class/ShardingManager).
Using the Node.js [cluster](https://nodejs.org/api/cluster.html) module, Discord.js Cluster spreads all [ShardingManager](https://discord.js.org/#/docs/main/stable/class/ShardingManager)s evenly among cores, and is easy to implement!## Installation
With npm:
```bash
$ npm install discord.js-cluster
```With yarn:
```bash
$ yarn add discord.js-cluster
```## Usage
Can be used exactly like the [ShardingManager](https://discord.js.org/#/docs/main/stable/class/ShardingManager)
`index.js:````javascript
const { ClusterManager } = require('discord.js-cluster');const manager = new ClusterManager('./bot.js', { token: 'your-token-goes-here' });
manager.on('clusterCreate', cluster => console.log(`Launched cluster ${cluster.id}`));
manager.spawn();
````bot.js:`
```javascript
const { Client } = require('discord.js-cluster');
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!
```## [Documentation](https://mrgriefs.github.io/discord.js-cluster)
You can find more documentation on the [website](https://mrgriefs.github.io/discord.js-cluster).