feat(VoiceState): self mute/deaf methods (#3243)

* Implemented setSelfMute/Deaf, done typings, fixed bug in VoiceState with errors.

* Completed requested changes

* return send in sendVoiceStateUpdate so its a promise, update typings

* Updated methods to return a boolean

* Requested changes

* Fix bug

* Update src/structures/VoiceState.js

Co-Authored-By: MrJacz <23615291+MrJacz@users.noreply.github.com>

* fix
This commit is contained in:
Jacz
2019-05-04 01:11:11 +10:00
committed by SpaceEEC
parent a59968f7de
commit 692494dc04
4 changed files with 40 additions and 5 deletions

7
typings/index.d.ts vendored
View File

@@ -1202,7 +1202,7 @@ declare module 'discord.js' {
private onSessionDescription(mode: string, secret: string): void;
private onSpeaking(data: object): void;
private reconnect(token: string, endpoint: string): void;
private sendVoiceStateUpdate(options: object): void;
private sendVoiceStateUpdate(options: object): Promise<Shard>;
private setSessionID(sessionID: string): void;
private setSpeaking(value: BitFieldResolvable<SpeakingString>): void;
private setTokenAndEndpoint(token: string, endpoint: string): void;
@@ -1215,6 +1215,7 @@ declare module 'discord.js' {
public receiver: VoiceReceiver;
public speaking: Readonly<Speaking>;
public status: VoiceStatus;
public readonly voice: VoiceState;
public voiceManager: ClientVoiceManager;
public disconnect(): void;
public play(input: VoiceBroadcast | Readable | string, options?: StreamOptions): StreamDispatcher;
@@ -1284,8 +1285,10 @@ declare module 'discord.js' {
public sessionID?: string;
public readonly speaking: boolean | null;
public setDeaf(mute: boolean, reason?: string): Promise<GuildMember>;
public setDeaf(deaf: boolean, reason?: string): Promise<GuildMember>;
public setMute(mute: boolean, reason?: string): Promise<GuildMember>;
public setSelfDeaf(deaf: boolean): Promise<boolean>;
public setSelfMute(mute: boolean): Promise<boolean>;
}
class VolumeInterface extends EventEmitter {