Skip to content

DisTubeVoiceManager

Manages voice connections

new DisTubeVoiceManager(distube): DisTubeVoiceManager;

Create a new base object.

DisTube

The DisTube instance

DisTubeVoiceManager

GuildIdManager.constructor

collection: Collection<string, DisTubeVoice>;

The collection of items for this manager.

GuildIdManager.collection


distube: DisTube;

The DisTube instance this object belongs to.

GuildIdManager.distube

get client(): Client;

Discord.js client

Client

GuildIdManager.client


get handler(): DisTubeHandler;

DisTube handler

DisTubeHandler

GuildIdManager.handler


get options(): Options;

DisTube options

Options

GuildIdManager.options


get plugins(): DisTubePlugin[];

DisTube plugins

DisTubePlugin[]

GuildIdManager.plugins


get queues(): QueueManager;

The queue manager

QueueManager

GuildIdManager.queues


get size(): number;

The size of the collection.

number

GuildIdManager.size


get voices(): DisTubeVoiceManager;

The voice manager

DisTubeVoiceManager

GuildIdManager.voices

add(idOrInstance, data): DisTubeVoiceManager;

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

DisTubeVoice

The item to add

DisTubeVoiceManager

This manager, to allow chaining

DisTubeError When the value cannot be resolved to a guild id

GuildIdManager.add


create(channel): DisTubeVoice;

Create a DisTubeVoice instance

VoiceBasedChannel

A voice channel to join

DisTubeVoice

The voice connection of the guild

DisTubeError When the guild already has a voice connection that is not managed by DisTube


debug(message): void;

Emit debug event

string

debug message

void

Nothing

GuildIdManager.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

GuildIdManager.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

GuildIdManager.emitError


get(idOrInstance):
| DisTubeVoice
| undefined;

Get the item of a guild.

GuildIdResolvable

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

| DisTubeVoice | undefined

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

DisTubeError When the value cannot be resolved to a guild id

GuildIdManager.get


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

GuildIdManager.has


join(channel): Promise<DisTubeVoice>;

Join a voice channel and wait until the connection is ready

VoiceBasedChannel

A voice channel to join

Promise<DisTubeVoice>

The voice connection of the guild

DisTubeError When the connection cannot be established


leave(guild): void;

Leave the connected voice channel in a guild

GuildIdResolvable

Queue Resolvable

void

Nothing


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

GuildIdManager.remove