Skip to content

Commit

Permalink
fix(TextChannel,VoiceChannel): reintroduce nsfw property (#112)
Browse files Browse the repository at this point in the history
Probably accidentally removed while merging an upstream PR, I think this should cover all the NSFW-able channel types.
  • Loading branch information
TTtie committed Jan 9, 2024
1 parent e366d6a commit 940ec4a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/structures/TextChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class TextChannel extends GuildChannel {
if(data.position !== undefined) {
this.position = data.position;
}
if(data.nsfw !== undefined) {
this.nsfw = data.nsfw;
}
}

/**
Expand Down
2 changes: 0 additions & 2 deletions lib/structures/TextVoiceChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const Message = require("./Message");
* @extends VoiceChannel
* @prop {String} lastMessageID The ID of the last message in this channel
* @prop {Collection<Message>} messages Collection of Messages in this channel
* @prop {Boolean} nsfw Whether the channel is an NSFW channel or not
* @prop {Number} rateLimitPerUser The ratelimit of the channel, in seconds. 0 means no ratelimit is enabled
* @prop {Number?} userLimit The max number of users that can join the channel
* @prop {Number?} videoQualityMode The camera video quality mode of the voice channel. `1` is auto, `2` is 720p
Expand All @@ -18,7 +17,6 @@ class TextVoiceChannel extends VoiceChannel {
constructor(data, client, messageLimit) {
super(data, client);
this.messages = new Collection(Message, messageLimit == null ? client.options.messageLimit : messageLimit);
this.nsfw = data.nsfw;
this.lastMessageID = data.last_message_id || null;
}

Expand Down
4 changes: 4 additions & 0 deletions lib/structures/VoiceChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const PermissionOverwrite = require("./PermissionOverwrite");
* Represents a guild voice channel. See GuildChannel for more properties and methods.
* @extends GuildChannel
* @prop {Number?} bitrate The bitrate of the channel
* @prop {Boolean} nsfw Whether the channel is an NSFW channel or not
* @prop {Collection<PermissionOverwrite>} permissionOverwrites Collection of PermissionOverwrites in this channel
* @prop {Number} position The position of the channel
* @prop {String?} rtcRegion The RTC region ID of the channel (automatic when `null`)
Expand Down Expand Up @@ -38,6 +39,9 @@ class VoiceChannel extends GuildChannel {
if(data.position !== undefined) {
this.position = data.position;
}
if(data.nsfw !== undefined) {
this.nsfw = data.nsfw;
}
}

/**
Expand Down

0 comments on commit 940ec4a

Please sign in to comment.