diff --git a/packages/discord.js/src/structures/VoiceChannel.js b/packages/discord.js/src/structures/VoiceChannel.js index df8268b34..e85cef2f1 100644 --- a/packages/discord.js/src/structures/VoiceChannel.js +++ b/packages/discord.js/src/structures/VoiceChannel.js @@ -20,6 +20,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); } @@ -55,6 +61,10 @@ class VoiceChannel extends BaseGuildVoiceChannel { */ this.rateLimitPerUser = data.rate_limit_per_user; } + + if ('nsfw' in data) { + this.nsfw = Boolean(data.nsfw); + } } /** diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 7789bd559..7fd47174d 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -2716,6 +2716,7 @@ export class VoiceChannel extends TextBasedChannelMixin(BaseGuildVoiceChannel, [ public videoQualityMode: VideoQualityMode | null; public get speakable(): boolean; public type: ChannelType.GuildVoice; + public nsfw: boolean; public rateLimitPerUser: number | null; public setBitrate(bitrate: number, reason?: string): Promise; public setUserLimit(userLimit: number, reason?: string): Promise;