Sharding Manager Adapter

A Sharding Manager with the needed utilities to minimize the extra work, errors and evals needed to provide to a DiscordJS Sharding Manager.

Pure Nim score 15/100 · last commit 2019-04-09 · 1 stars · tests present · no docs generated

Summary

Latest Version Unknown
License Unknown
CI Status Failing
Stars 1
Forks 0
Open Issues 0
Last Commit 2019-04-09
Downloads 0
Last Indexed 2026-08-10 05:05

Installation

nimble install Sharding Manager Adapter
choosenim install Sharding Manager Adapter
git clone https://gitlab.com/dispanel/sharding-manager-adapter

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
Sharding Manager Adapter - - - - - - -

README

Sharding Manager Adapter - DiscordJS

This module is an adapter on top of DiscordJS.ShardingManager.

It helps to perform any process without bugs, more elegant and faster without worrying about what a broadcast produced, if you had a syntax error on an eval, how ugly the broadcast evals look or having to worry on how to make your own Sharding Manager Adapter.

Making your first app

// index.js
import { ShardingManagerAdapter } from '@dispanel/sharding-manager-adapter';

// Instantiate Sharding Manager Adapter singleton
const token = 'my_private_bot_token';
const clientDir = './src/client.js';
const totalShards = 4;
ShardingManagerAdapter.createInstace(clientDir, token, totalShards);

// Get all categories
async () => {
  const categories = await ShardingManagerAdapter
                      .client
                      .guilds
                      .categories.getAll('guildID here');
  console.log(categories);
};
// Create a new channel
async () => {
  const newChannel = await ShardingManagerAdapter
                            .client
                            .guilds
                            .channels.create('guildID Here', 'channel name')
});

// client.js
import { Client } from 'discord.js';

// Shard arguments
const token = process.argv[2];
const totalShards = process.argv[3];

// Client instantiation
const client = new Client();

// Login with the token provided to the shard by the ShardingManagerAdapter
client.login(token)
};

Docs


ShardingManagerAdapter

createInstance (clientPath: string, token: string, totalShards: number) : Promise

Creates a new singleton DiscordJS.ShardingManager instance and automatically spawns all the shards.

getInstance () : Promise

Description

Returns the ShardingManager singleton instance.

At most, you wont need to use this unless you want to do something manually.


ShardingManagerAdapter.client

Nothing yet


ShardingManagerAdapter.client.guilds

get (guildID: string) : Promise\

Returns the guild with the specified guild ID

getAll() : Promise

getName(guildID: string) : Promise\

setName(guildID: string, name: string) : Promise\


ShardingManagerAdapter.client.guilds.channels

create (guildID: string, name: string, options: DiscordJS.GuildCreateChannelOptions) : Promise\

get (guildID: string) : Promise\

getAll() : Promise

getName(guildID: string) : Promise\

setName(guildID: string, name: string) : Promise\


ShardingManagerAdapter.client.guilds.categories

create (guildID: string, name: string, options: string) : Promise\

get (guildID: string) : Promise\

getAll() : Promise

getName(guildID: string) : Promise\

setName(guildID: string, name: string) : Promise\