Skip to content

Commit

Permalink
fix(VoiceChannel): NSFW property (v13) (#8161)
Browse files Browse the repository at this point in the history
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
Co-authored-by: pat <73502164+nyapat@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 23, 2022
1 parent 65444f5 commit c61fc80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/structures/VoiceChannel.js
Expand Up @@ -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);
}

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

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

/**
Expand Down
1 change: 1 addition & 0 deletions typings/index.d.ts
Expand Up @@ -2660,6 +2660,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>;
Expand Down

0 comments on commit c61fc80

Please sign in to comment.