Skip to content

Commit

Permalink
Support system channel flags (#1067)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsshieh authored Nov 29, 2020
1 parent 592313d commit 984ffbb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ declare namespace Eris {
region: string;
rulesChannelID?: string;
splash?: string;
systemChannelFlags: 0 | 1 | 2;
systemChannelID?: string;
verificationLevel: 0 | 1 | 2 | 3 | 4;
}
Expand Down Expand Up @@ -574,6 +575,7 @@ declare namespace Eris {
region?: string;
rulesChannelID?: string;
splash?: string;
systemChannelFlags: 0 | 1 | 2;
systemChannelID?: string;
verificationLevel?: number;
}
Expand Down Expand Up @@ -1697,6 +1699,7 @@ declare namespace Eris {
shard: Shard;
splash: string | null;
splashURL: string | null;
systemChannelFlags: 0 | 1 | 2;
systemChannelID: string | null;
unavailable: boolean;
vanityURL: string | null;
Expand Down
2 changes: 2 additions & 0 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ class Client extends EventEmitter {
* @arg {String} [options.region] The region of the guild
* @arg {String} [options.rulesChannelID] The id of the channel where "PUBLIC" guilds display rules and/or guidelines
* @arg {String} [options.splash] The guild splash image as a base64 data URI (VIP only). Note: base64 strings alone are not base64 data URI strings
* @arg {Number} [options.systemChannelFlags] The flags for the system channel
* @arg {String} [options.systemChannelID] The ID of the system channel
* @arg {Number} [options.verificationLevel] The guild verification level
* @arg {String} [reason] The reason to be displayed in audit logs
Expand All @@ -913,6 +914,7 @@ class Client extends EventEmitter {
default_message_notifications: options.defaultNotifications,
explicit_content_filter: options.explicitContentFilter,
system_channel_id: options.systemChannelID,
system_channel_flags: options.systemChannelFlags,
rules_channel_id: options.rulesChannelID,
public_updates_channel_id: options.publicUpdatesChannelID,
preferred_locale: options.preferredLocale,
Expand Down
2 changes: 2 additions & 0 deletions lib/gateway/Shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,7 @@ class Shard extends EventEmitter {
region: guild.region,
rulesChannelID: guild.rulesChannelID,
splash: guild.splash,
systemChannelFlags: guild.systemChannelFlags,
systemChannelID: guild.systemChannelID,
verificationLevel: guild.verificationLevel
};
Expand Down Expand Up @@ -1247,6 +1248,7 @@ class Shard extends EventEmitter {
* @prop {String} oldGuild.region The region of the guild
* @prop {String?} oldGuild.rulesChannelID The channel where "PUBLIC" guilds display rules and/or guidelines
* @prop {String?} oldGuild.splash The hash of the guild splash image, or null if no splash (VIP only)
* @prop {Number} oldGuild.systemChannelFlags the flags for the system channel
* @prop {String?} oldGuild.systemChannelID The ID of the default channel for system messages (built-in join messages and boost messages)
* @prop {Number} oldGuild.verificationLevel The guild verification level
*/
Expand Down
5 changes: 5 additions & 0 deletions lib/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const {Permissions} = require("../Constants");
* @prop {Shard} shard The Shard that owns the guild
* @prop {String?} splash The hash of the guild splash image, or null if no splash (VIP only)
* @prop {String?} splashURL The URL of the guild's splash image
* @prop {Number} systemChannelFlags The flags for the system channel
* @prop {String?} systemChannelID The ID of the default channel for system messages (built-in join messages and boost messages)
* @prop {Boolean} unavailable Whether the guild is unavailable or not
* @prop {String?} vanityURL The vanity URL of the guild (VIP only)
Expand Down Expand Up @@ -198,6 +199,9 @@ class Guild extends Base {
if(data.system_channel_id !== undefined) {
this.systemChannelID = data.system_channel_id;
}
if(data.system_channel_flags !== undefined) {
this.systemChannelFlags = data.system_channel_flags;
}
if(data.premium_tier !== undefined) {
this.premiumTier = data.premium_tier;
}
Expand Down Expand Up @@ -389,6 +393,7 @@ class Guild extends Base {
* @arg {String} [options.region] The region of the guild
* @arg {String} [options.rulesChannelID] The id of the channel where "PUBLIC" guilds display rules and/or guidelines
* @arg {String} [options.splash] The guild splash image as a base64 data URI (VIP only). Note: base64 strings alone are not base64 data URI strings
* @arg {Number} [options.systemChannelFlags] The flags for the system channel
* @arg {String} [options.systemChannelID] The ID of the system channel
* @arg {Number} [options.verificationLevel] The guild verification level
* @arg {String} [reason] The reason to be displayed in audit logs
Expand Down

0 comments on commit 984ffbb

Please sign in to comment.