Skip to content

Commit

Permalink
Expose Guild#nsfw (abalabahaha#1177)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsian03 authored Apr 14, 2021
1 parent fcd608d commit 9223266
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ declare namespace Eris {
maxVideoChannelUsers?: number;
mfaLevel: 0 | 1;
name: string;
nsfw: boolean;
ownerID: string;
preferredLocale?: string;
premiumSubscriptionCount?: number;
Expand Down Expand Up @@ -1840,6 +1841,7 @@ declare namespace Eris {
members: Collection<Member>;
mfaLevel: number;
name: string;
nsfw: boolean;
ownerID: string;
preferredLocale: string;
premiumSubscriptionCount?: number;
Expand Down
2 changes: 2 additions & 0 deletions lib/gateway/Shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,7 @@ class Shard extends EventEmitter {
maxVideoChannelUsers: guild.maxVideoChannelUsers,
mfaLevel: guild.mfaLevel,
name: guild.name,
nsfw: guild.nsfw,
ownerID: guild.ownerID,
preferredLocale: guild.preferredLocale,
premiumTier: guild.premiumTier,
Expand Down Expand Up @@ -1265,6 +1266,7 @@ class Shard extends EventEmitter {
* @prop {Number} oldGuild.maxPresences The maximum number of people that can be online in a guild at once (returned from REST API only)
* @prop {Number} oldGuild.mfaLevel The admin 2FA level for the guild. 0 is not required, 1 is required
* @prop {String} oldGuild.name The name of the guild
* @prop {String} oldGuild.nsfw Whether the guild is designated as NSFW by Discord
* @prop {String} oldGuild.ownerID The ID of the user that is the guild owner
* @prop {String} oldGuild.preferredLocale Preferred "COMMUNITY" guild language used in server discovery and notices from Discord
* @prop {String?} oldGuild.publicUpdatesChannelID ID of the guild's updates channel if the guild has "COMMUNITY" features
Expand Down
4 changes: 4 additions & 0 deletions lib/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const {Permissions} = require("../Constants");
* @prop {Number} memberCount Number of members in the guild
* @prop {Collection<Member>} members Collection of Members in the guild
* @prop {String} name The name of the guild
* @prop {Boolean} nsfw Whether the guild is designated as NSFW by Discord
* @prop {String} ownerID The ID of the user that is the guild owner
* @prop {String} preferredLocale Preferred "COMMUNITY" guild language used in server discovery and notices from Discord
* @prop {Number?} premiumSubscriptionCount The total number of users currently boosting this guild
Expand Down Expand Up @@ -281,6 +282,9 @@ class Guild extends Base {
})
};
}
if(data.nsfw !== undefined) {
this.nsfw = data.nsfw;
}
}

get bannerURL() {
Expand Down

0 comments on commit 9223266

Please sign in to comment.