fix(VoiceChannel): NSFW property (v13)

https://github.com/discordjs/discord.js/pull/8161
v13.8.1
This commit is contained in:
Cinnamon 2022-06-24 08:50:57 +07:00
parent 64c7dd5dd7
commit 4c0dfadc05
2 changed files with 11 additions and 0 deletions

View File

@ -24,6 +24,12 @@ class VoiceChannel extends BaseGuildVoiceChannel {
*/
this.messages = new MessageManager(this);
/**
* If the guild considers this channel NSFW
* @type {boolean}
*/
this.nsfw = Boolean(data.nsfw);
this._patch(data);
}
@ -59,6 +65,10 @@ class VoiceChannel extends BaseGuildVoiceChannel {
*/
this.rateLimitPerUser = data.rate_limit_per_user;
}
if ('nsfw' in data) {
this.nsfw = data.nsfw;
}
}
/**

1
typings/index.d.ts vendored
View File

@ -2802,6 +2802,7 @@ export class VoiceChannel extends TextBasedChannelMixin(BaseGuildVoiceChannel, [
public readonly editable: boolean;
public readonly speakable: boolean;
public type: 'GUILD_VOICE';
public nsfw: boolean;
public rateLimitPerUser: number | null;
public setBitrate(bitrate: number, reason?: string): Promise<VoiceChannel>;
public setUserLimit(userLimit: number, reason?: string): Promise<VoiceChannel>;