feat: @discordjs/voice
This commit is contained in:
parent
a0d3859230
commit
3378d5cfd7
3 changed files with 12 additions and 3 deletions
|
@ -93,6 +93,13 @@ class VoiceSubscription extends EventEmitter<VoiceEvents> {
|
|||
return this.audioPlayer.state.status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnects from voice
|
||||
*/
|
||||
disconnect() {
|
||||
this.voiceConnection.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the player
|
||||
*/
|
||||
|
|
|
@ -40,8 +40,9 @@ class VoiceUtils {
|
|||
* Disconnects voice connection
|
||||
* @param {VoiceConnection} connection The voice connection
|
||||
*/
|
||||
public static disconnect(connection: VoiceConnection) {
|
||||
connection.destroy();
|
||||
public static disconnect(connection: VoiceConnection | VoiceSubscription) {
|
||||
if (connection instanceof VoiceSubscription) return connection.voiceConnection.destroy();
|
||||
else connection.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
export {};
|
||||
export { VoiceUtils } from "./VoiceInterface/VoiceUtils";
|
||||
export { VoiceEvents, VoiceSubscription } from "./VoiceInterface/VoiceSubscription";
|
||||
|
|
Loading…
Reference in a new issue