mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
feat(VoiceState): add kick method (#3462)
* feat(VoiceState): add kick method * feat(typings): add types for VoiceState#kick method
This commit is contained in:
@@ -139,6 +139,15 @@ class VoiceState extends Base {
|
|||||||
return this.member ? this.member.edit({ deaf }, reason) : Promise.reject(new Error('VOICE_STATE_UNCACHED_MEMBER'));
|
return this.member ? this.member.edit({ deaf }, reason) : Promise.reject(new Error('VOICE_STATE_UNCACHED_MEMBER'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Kicks the member from the voice channel.
|
||||||
|
* @param {string} [reason] Reason for kicking member from the channel
|
||||||
|
* @returns {Promise<GuildMember>}
|
||||||
|
*/
|
||||||
|
kick(reason) {
|
||||||
|
return this.setChannel(null, reason);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the member to a different channel, or kick them from the one they're in.
|
* Moves the member to a different channel, or kick them from the one they're in.
|
||||||
* @param {ChannelResolvable|null} [channel] Channel to move the member to, or `null` if you want to kick them from
|
* @param {ChannelResolvable|null} [channel] Channel to move the member to, or `null` if you want to kick them from
|
||||||
|
|||||||
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
@@ -1590,6 +1590,7 @@ declare module 'discord.js' {
|
|||||||
|
|
||||||
public setDeaf(deaf: boolean, reason?: string): Promise<GuildMember>;
|
public setDeaf(deaf: boolean, reason?: string): Promise<GuildMember>;
|
||||||
public setMute(mute: boolean, reason?: string): Promise<GuildMember>;
|
public setMute(mute: boolean, reason?: string): Promise<GuildMember>;
|
||||||
|
public kick(reason?: string): Promise<GuildMember>;
|
||||||
public setChannel(channel: ChannelResolvable | null, reason?: string): Promise<GuildMember>;
|
public setChannel(channel: ChannelResolvable | null, reason?: string): Promise<GuildMember>;
|
||||||
public setSelfDeaf(deaf: boolean): Promise<boolean>;
|
public setSelfDeaf(deaf: boolean): Promise<boolean>;
|
||||||
public setSelfMute(mute: boolean): Promise<boolean>;
|
public setSelfMute(mute: boolean): Promise<boolean>;
|
||||||
|
|||||||
Reference in New Issue
Block a user