discord-play
Version:
A robust wrapper module for @discordjs/voice, implementing functions and emitting events making it easier to interact with the new voice module.
40 lines • 1.36 kB
TypeScript
import { AudioPlayer, VoiceConnection } from '@discordjs/voice';
import { VoiceState } from 'discord.js';
import { TypedEmitter } from 'tiny-typed-emitter';
import { ConnectionEvents } from '../interfaces/events';
/**
* The voice connection class of `discord-play`. The bot joins the input voice state
* as soon as an instance is created.
*/
export declare class DisPlayConnection extends TypedEmitter<ConnectionEvents> {
/**
* The {@link VoiceConnection} instance from @discordjs/voice.
*/
readonly connection: VoiceConnection;
private readyLock;
private oldVoiceID;
/**
* Joins the voice channel on instance creation.
* @param voice The voice state of a member.
*/
constructor(voice: VoiceState);
/**
* The {@link AudioPlayer} attached to the voice connection (if any).
*/
get player(): AudioPlayer | undefined;
/**
* Toggle self-deafening of the bot.
* @returns `true` if self-deafened, otherwise `false` i.e. self-undeafened.
*/
toggleDeafen(): boolean;
/**
* Toggle self-muting of the bot.
* @returns `true` if self-muted, otherwise `false` i.e. self-unmuted.
*/
toggleMute(): boolean;
/**
* Destroys the voice connection, making it unable to be reused again.
*/
destroy(): void;
}
//# sourceMappingURL=connection.d.ts.map