Skip to content

Commit

Permalink
fix(vcs): nsfw property (#8132)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyapat committed Jun 21, 2022
1 parent f1ac17c commit 2eeaad6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/discord.js/src/structures/VoiceChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -55,6 +61,10 @@ class VoiceChannel extends BaseGuildVoiceChannel {
*/
this.rateLimitPerUser = data.rate_limit_per_user;
}

if ('nsfw' in data) {
this.nsfw = Boolean(data.nsfw);
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<VoiceChannel>;
public setUserLimit(userLimit: number, reason?: string): Promise<VoiceChannel>;
Expand Down

0 comments on commit 2eeaad6

Please sign in to comment.