DisTubeVoiceManager
Manages voice connections
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DisTubeVoiceManager(distube): DisTubeVoiceManager;Create a new base object.
Parameters
Section titled “Parameters”distube
Section titled “distube”The DisTube instance
Returns
Section titled “Returns”DisTubeVoiceManager
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”collection
Section titled “collection”collection: Collection<string, DisTubeVoice>;The collection of items for this manager.
Inherited from
Section titled “Inherited from”distube
Section titled “distube”distube: DisTube;The DisTube instance this object belongs to.
Inherited from
Section titled “Inherited from”Accessors
Section titled “Accessors”client
Section titled “client”Get Signature
Section titled “Get Signature”get client(): Client;Discord.js client
Returns
Section titled “Returns”Client
Inherited from
Section titled “Inherited from”handler
Section titled “handler”Get Signature
Section titled “Get Signature”get handler(): DisTubeHandler;DisTube handler
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”options
Section titled “options”Get Signature
Section titled “Get Signature”get options(): Options;DisTube options
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”plugins
Section titled “plugins”Get Signature
Section titled “Get Signature”get plugins(): DisTubePlugin[];DisTube plugins
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”queues
Section titled “queues”Get Signature
Section titled “Get Signature”get queues(): QueueManager;The queue manager
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Get Signature
Section titled “Get Signature”get size(): number;The size of the collection.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”voices
Section titled “voices”Get Signature
Section titled “Get Signature”get voices(): DisTubeVoiceManager;The voice manager
Returns
Section titled “Returns”DisTubeVoiceManager
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”add(idOrInstance, data): DisTubeVoiceManager;Add an item to the collection.
The item is not added when there is already one for the same guild.
Parameters
Section titled “Parameters”idOrInstance
Section titled “idOrInstance”The guild id, or anything that can be resolved to a guild id
The item to add
Returns
Section titled “Returns”DisTubeVoiceManager
This manager, to allow chaining
Throws
Section titled “Throws”DisTubeError When the value cannot be resolved to a guild id
Inherited from
Section titled “Inherited from”create()
Section titled “create()”create(channel): DisTubeVoice;Create a DisTubeVoice instance
Parameters
Section titled “Parameters”channel
Section titled “channel”VoiceBasedChannel
A voice channel to join
Returns
Section titled “Returns”The voice connection of the guild
Throws
Section titled “Throws”DisTubeError When the guild already has a voice connection that is not managed by DisTube
debug()
Section titled “debug()”debug(message): void;Emit debug event
Parameters
Section titled “Parameters”message
Section titled “message”string
debug message
Returns
Section titled “Returns”void
Nothing
Inherited from
Section titled “Inherited from”emit()
Section titled “emit()”emit(eventName, ...args): boolean;Emit the DisTube of this base
Parameters
Section titled “Parameters”eventName
Section titled “eventName”keyof DisTubeEvents
Event name
…any
arguments
Returns
Section titled “Returns”boolean
true when the event had listeners, false otherwise
Inherited from
Section titled “Inherited from”emitError()
Section titled “emitError()”emitError( error, queue, song?): void;Emit error event
Parameters
Section titled “Parameters”Error
error
The queue encountered the error
Song<unknown>
The playing song when encountered the error
Returns
Section titled “Returns”void
Nothing
Inherited from
Section titled “Inherited from”get(idOrInstance): | DisTubeVoice | undefined;Get the item of a guild.
Parameters
Section titled “Parameters”idOrInstance
Section titled “idOrInstance”The guild id, or anything that can be resolved to a guild id
Returns
Section titled “Returns”| DisTubeVoice
| undefined
The item of the guild, or undefined when there is none
Throws
Section titled “Throws”DisTubeError When the value cannot be resolved to a guild id
Inherited from
Section titled “Inherited from”has(idOrInstance): boolean;Check whether a guild has an item.
Parameters
Section titled “Parameters”idOrInstance
Section titled “idOrInstance”The guild id, or anything that can be resolved to a guild id
Returns
Section titled “Returns”boolean
true when there is an item for the guild
Throws
Section titled “Throws”DisTubeError When the value cannot be resolved to a guild id
Inherited from
Section titled “Inherited from”join()
Section titled “join()”join(channel): Promise<DisTubeVoice>;Join a voice channel and wait until the connection is ready
Parameters
Section titled “Parameters”channel
Section titled “channel”VoiceBasedChannel
A voice channel to join
Returns
Section titled “Returns”Promise<DisTubeVoice>
The voice connection of the guild
Throws
Section titled “Throws”DisTubeError When the connection cannot be established
leave()
Section titled “leave()”leave(guild): void;Leave the connected voice channel in a guild
Parameters
Section titled “Parameters”Queue Resolvable
Returns
Section titled “Returns”void
Nothing
remove()
Section titled “remove()”remove(idOrInstance): boolean;Remove the item of a guild.
Parameters
Section titled “Parameters”idOrInstance
Section titled “idOrInstance”The guild id, or anything that can be resolved to a guild id
Returns
Section titled “Returns”boolean
true when an item was removed, false otherwise
Throws
Section titled “Throws”DisTubeError When the value cannot be resolved to a guild id