Skip to content

Commit

Permalink
Use new NSFW logic (#282)
Browse files Browse the repository at this point in the history
* Use NSFW value returned by discord api

* Updated nsfw check
  • Loading branch information
Thewsomeguy authored and abalabahaha committed Aug 20, 2017
1 parent 6fada36 commit 0f1d776
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/structures/GuildChannel.js
Expand Up @@ -49,6 +49,7 @@ class GuildChannel extends Channel {
this.position = data.position !== undefined ? data.position : this.position;
this.bitrate = data.bitrate !== undefined ? data.bitrate : this.bitrate;
this.userLimit = data.user_limit !== undefined ? data.user_limit : this.userLimit;
this.nsfw = this.type !== 2 && ((this.name.length === 4 ? this.name === "nsfw" : this.name.startsWith("nsfw-")) || data.nsfw);
if(data.permission_overwrites) {
this.permissionOverwrites = new Collection(PermissionOverwrite);
data.permission_overwrites.forEach((overwrite) => {
Expand Down Expand Up @@ -92,10 +93,6 @@ class GuildChannel extends Channel {
return `<#${this.id}>`;
}

get nsfw() {
return this.type !== 2 && (this.name.length === 4 ? this.name === "nsfw" : this.name.startsWith("nsfw-"));
}

/**
* Edit the channel's properties
* @arg {Object} options The properties to edit
Expand Down

0 comments on commit 0f1d776

Please sign in to comment.