A lightweight (the actual ship is heavy though), performat & powerful sharder for Discord.JS. Indomitable uses cluster module to evenly spread her weight (load) across your cores

Overview

Indomitable

A lightweight (the actual ship is heavy though), performat & powerful sharder for Discord.JS. Indomitable uses cluster module to evenly spread her weight (load) across your cores

The ShipGirl Project; ⓒ Azur Lane

  • Supports Discord.JS v13 and discord.js@dev

Installation

  • Stable

npm install indomitable

  • Dev

npm install https://github.com/Deivu/Indomitable.git#master

Documentation

🔗 https://deivu.github.io/Indomitable/index.html

Example Usage

Basic usage

const { Indomitable } = require('indomitable');
const { Client } = require('discord.js');
const token = 'your_token';

const manager = new Indomitable({ client: Client, token })
    .on('error', console.error);

manager.spawn();

Basic usage with more Indomitable Options

const { Indomitable } = require('indomitable');
const { Client } = require('discord.js');
const token = 'your_token';

const options = {
    // Processes to run
    clusterCount: 2,
    // Websocket shards to run
    shardCount: 8,
    // Discord.JS options
    clientOptions: {
        intents: [1 << 0] // Bitwise for GUILD intent only
    },
    // Auto restart processes that have been killed
    autoRestart: true, // This defaults to false by default unless you specify it
    // Your Discord.JS client
    client: Client,
    // Your bot token
    token
}

const manager = new Indomitable(client)
    .on('error', console.error);

manager.spawn();

Broadcasteval as one way to get data across shards

// Saya's note:
// Not recommended as every broadcastEval uses eval() internally
// Consider learning the ipc system of this library in future to get data across your clusters
client.shard
    .broadcastEval(client => client.guilds.cache.size)
    .then(console.log);

Notes

  • You don't need to call client.login('token'); yourself, Indomitable will call it for you.

  • Extended clients that extend from discord.js client will work, as long as you use client.login('token'); to get your bot running

  • For fastest performance possible, install the optional dependency MessagePack npm i --save msgpackr

  • Your Discord.JS Client ShardClientUtil is replaced with Indomitable's ShardClientUtil. Refer to our docs for documentation 🔗 https://deivu.github.io/Indomitable/classes/client_ShardClientUtil.ShardClientUtil.html

Indomitable Options

Option Type Description Required Default
clusterCount number or 'auto' How many clusters we should spawn No 'auto'
shardCount number or 'auto' How many websocket shards we should make No 'auto'
clientOptions Object Discord.JS Client Options No {}
ipcOptions Object{primary?: {}, worker?: {}} Options for net-ipc No {}
nodeArgs string[] Node arguments to pass to a cluster No []
ipcTimeout number Timeout before we fail a request No 60000
spawnTimeout number Timeout before we fail a cluster spawn No 60000 (multiplied by clusterShardCount internally)
spawnDelay number Time to wait before spawning a new cluster No 5000
autoRestart boolean If you want to auto restart the shards that have been killed unintentionally No false
client Client Your Discord.JS non modified OR modified client Yes None
token strubg The token of your bot Yes None

Made with by

@Sāya#0113 (https://github.com/Deivu/)

You might also like...

This application displays scores submitted by different players from an API service. It also allows a user to submit his/her score while saving the data on the API.

Leaderboard This application displays scores submitted by different players from an API service. It also allows a user to submit his/her score while p

Jul 15, 2022

Displaying actual age in percentage with 9 signs after dot (floating number)

Displaying actual age in percentage with 9 signs after dot (floating number)

Actual Age Chrome Extension Displaying actual age in percentage with 9 signs after dot (floating number) Features Popup You can select your Birth date

Nov 2, 2022

Transform URLs in strings to actual links.

Transform URLs in strings to actual links.

Transform URLs in strings to actual links. It will find valid links in the given string and create a tags for it. Internally, it uses this Regex to

Nov 4, 2022

Actual, a local-first personal finance tool

This is the main project to run Actual, a local-first personal finance tool. It comes with the latest version of Actual, and a server to persist chang

Jan 3, 2023

Powercord plugin to make "divider" roles into actual dividers

Powercord plugin to make

Powecord Role Dividers Install in Replugged Turns "divider" roles into actual dividers. Before: After: A divider role I have is not being shown as a d

Dec 28, 2022

An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

Dec 28, 2022

A Kubernetes monitoring tool to visualize large-scale activity and real-time comprehensive metrics within your cluster.

A Kubernetes monitoring tool to visualize large-scale activity and real-time comprehensive metrics within your cluster.

Armada A light-weight Kubernetes health monitoring tool. Summary Armada is an open-source tool for monitoring the health of your Kubernetes cluster. I

Nov 2, 2022

🔥 A Powerful JavaScript Module for Generating and Checking Discord Nitro 🌹

🔥 A Powerful JavaScript Module for Generating and Checking Discord Nitro 🌹

DANG: Dreamy's Awesome Nitro Generator Join Our Discord Getting Started Before, We start please follow these Steps: Required* ⭐ Give a Star to this dr

Jan 5, 2023

A light-weight user's step-by-step guide for your website using Vanilla JS.

WebTour JS A light-weight user's step-by-step guide for your website using Vanilla JS. Features User's walkthrough - can be used to guide user's to yo

Nov 21, 2022
Owner
Saya
Node.JS & Java hobbyist programmer. A man with dead eyes that has no goal in life. Owner & Developer of KashimaBot, Developer of ChipBot
Saya
A light-weight, simple, and straightforward learning tool for your Kubernetes cluster

Introducing Neptune Light-weight, simple, and straightforward learning tool for your Kubernetes cluster Neptune is an approachable learning tool, ligh

OSLabs Beta 109 Jan 4, 2023
🚀 Send a load of requests with nodejs using cluster and with/without Tor for anonymisation 🙈

Accumulator ?? Send a load of requests with nodejs using cluster and with/without Tor for anonymisation ?? ⚠️ Disclamer, This repo has been created fo

Adrien de Peretti 7 Nov 21, 2022
Is your site too light? Make it heavy with a single script!

heavy.js Is your site too light? Need more pizzaz? Make it heavy with a single, zero dependency script. How to? Just add this snippet to your HTML: <s

Akshit Garg 59 Dec 18, 2022
Make your first Pull Request on Hacktoberfest 2022. Don't forget to spread love and if you like give us a star

Hacktoberfest2022 Make your first Pull Request on Hacktoberfest 2022. Don't forget to spread love and if you like give us a star Quality of Pull Reque

Google Developer Students Club - Galgotias University 12 Oct 30, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A lightweight JavaScript library that renders text in a brilliant style by displaying strings of random characters before the actual text.

cryptoWriter.js A lightweight javascript library which creates brilliant text animation by rendering strings of random characters before the actual te

Keshav Bajaj 2 Sep 13, 2022
Essa API tem como objetivo auxiliar na produção de documentação de métodos e design packs, fornecendo de maneira visual a documentação de cores para api's

DocColors-API Essa API tem como objetivo auxiliar na produção de documentação de métodos e design packs, fornecendo de maneira visual a documentação d

Yhan Nunes 6 Feb 4, 2022
On this page, you can save and load all the awesome books you have and save the name and the author into the local storage. this project uses Javascript to interact with the pages

Awesome Books: refactor to use JavaScript classes In this project, We add the links to the applications into the final project Getting Started if you

Cesar Valencia 8 Nov 29, 2022