Socket
Socket
Sign inDemoInstall

discord.js-cluster

Package Overview
Dependencies
54
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    discord.js-cluster

A cluster manager for the Discord.js library


Version published
Weekly downloads
12
increased by300%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Discord.js Sharder

Patreon Discord Travis (.com) David node-current GitHub package.json version RunKit

Table of Contents

About

discord.js-cluster is a powerful cluster manager for the Discord.js library which implements multiprocessing to increase the performance of your client, heavily inspired by the Discord.js built-in ShardingManager.
Using the Node.js cluster module, Discord.js Cluster spreads all ShardingManagers evenly among cores, and is easy to implement!

Installation

With npm:

$ npm install discord.js-cluster

With yarn:

$ yarn add discord.js-cluster

Usage

Can be used exactly like the ShardingManager
index.js:

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:

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

You can find more documentation on the website.

Keywords

FAQs

Last updated on 18 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc