Skip to content

GuildIdManager

Manages the collection of a data model paired with a guild id.

V

new GuildIdManager<V>(distube): GuildIdManager<V>;

Create a new base object.

DisTube

The DisTube instance

GuildIdManager<V>

BaseManager.constructor

collection: Collection<string, V>;

The collection of items for this manager.

BaseManager.collection


distube: DisTube;

The DisTube instance this object belongs to.

BaseManager.distube

get client(): Client;

Discord.js client

Client

BaseManager.client


get handler(): DisTubeHandler;

DisTube handler

DisTubeHandler

BaseManager.handler


get options(): Options;

DisTube options

Options

BaseManager.options


get plugins(): DisTubePlugin[];

DisTube plugins

DisTubePlugin[]

BaseManager.plugins


get queues(): QueueManager;

The queue manager

QueueManager

BaseManager.queues


get size(): number;

The size of the collection.

number

BaseManager.size


get voices(): DisTubeVoiceManager;

The voice manager

DisTubeVoiceManager

BaseManager.voices

add(idOrInstance, data): GuildIdManager<V>;

Add an item to the collection.

The item is not added when there is already one for the same guild.

GuildIdResolvable

The guild id, or anything that can be resolved to a guild id

V

The item to add

GuildIdManager<V>

This manager, to allow chaining

DisTubeError When the value cannot be resolved to a guild id


debug(message): void;

Emit debug event

string

debug message

void

Nothing

BaseManager.debug


emit(eventName, ...args): boolean;

Emit the DisTube of this base

keyof DisTubeEvents

Event name

…any

arguments

boolean

true when the event had listeners, false otherwise

BaseManager.emit


emitError(
error,
queue,
song?
): void;

Emit error event

Error

error

Queue

The queue encountered the error

Song<unknown>

The playing song when encountered the error

void

Nothing

BaseManager.emitError


get(idOrInstance): V | undefined;

Get the item of a guild.

GuildIdResolvable

The guild id, or anything that can be resolved to a guild id

V | undefined

The item of the guild, or undefined when there is none

DisTubeError When the value cannot be resolved to a guild id


has(idOrInstance): boolean;

Check whether a guild has an item.

GuildIdResolvable

The guild id, or anything that can be resolved to a guild id

boolean

true when there is an item for the guild

DisTubeError When the value cannot be resolved to a guild id


remove(idOrInstance): boolean;

Remove the item of a guild.

GuildIdResolvable

The guild id, or anything that can be resolved to a guild id

boolean

true when an item was removed, false otherwise

DisTubeError When the value cannot be resolved to a guild id