Skip to content

Commit c61fc80

Browse files
JiraliteImRodrynyapat
authored
fix(VoiceChannel): NSFW property (v13) (#8161)
Co-authored-by: Rodry <[email protected]> Co-authored-by: pat <[email protected]>
1 parent 65444f5 commit c61fc80

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/structures/VoiceChannel.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ class VoiceChannel extends BaseGuildVoiceChannel {
2424
*/
2525
this.messages = new MessageManager(this);
2626

27+
/**
28+
* If the guild considers this channel NSFW
29+
* @type {boolean}
30+
*/
31+
this.nsfw = Boolean(data.nsfw);
32+
2733
this._patch(data);
2834
}
2935

@@ -59,6 +65,10 @@ class VoiceChannel extends BaseGuildVoiceChannel {
5965
*/
6066
this.rateLimitPerUser = data.rate_limit_per_user;
6167
}
68+
69+
if ('nsfw' in data) {
70+
this.nsfw = data.nsfw;
71+
}
6272
}
6373

6474
/**

typings/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2660,6 +2660,7 @@ export class VoiceChannel extends TextBasedChannelMixin(BaseGuildVoiceChannel, [
26602660
public readonly editable: boolean;
26612661
public readonly speakable: boolean;
26622662
public type: 'GUILD_VOICE';
2663+
public nsfw: boolean;
26632664
public rateLimitPerUser: number | null;
26642665
public setBitrate(bitrate: number, reason?: string): Promise<VoiceChannel>;
26652666
public setUserLimit(userLimit: number, reason?: string): Promise<VoiceChannel>;

0 commit comments

Comments
 (0)