Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support join raid protection #71

Merged
merged 2 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ declare namespace Dysnomia {
keyword_filter: string[];
/** valid for MENTION_SPAM */
mention_total_limit: number;
/** valid for MENTION_SPAM */
mention_raid_protection_enabled: boolean;
/** valid for KEYWORD_PRESET */
presets: AutoModerationKeywordPresetType[];
/** valid for KEYWORD */
Expand Down Expand Up @@ -599,6 +601,7 @@ declare namespace Dysnomia {
premiumTier: PremiumTier;
publicUpdatesChannelID: string | null;
rulesChannelID: string | null;
safetyAlertsChannelID: string | null;
splash: string | null;
stickers?: Sticker[];
systemChannelFlags: SystemChannelFlags;
Expand Down Expand Up @@ -1010,6 +1013,7 @@ declare namespace Dysnomia {
premiumProgressBarEnabled?: boolean;
publicUpdatesChannelID?: string;
rulesChannelID?: string;
safetyAlertsChannelID?: string;
splash?: string;
systemChannelFlags?: number;
systemChannelID?: string;
Expand Down Expand Up @@ -1991,6 +1995,7 @@ declare namespace Dysnomia {
"NEWS",
"PARTNERED",
"PREVIEW_ENABLED",
"RAID_ALERTS_DISABLED",
"ROLE_ICONS",
"ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE",
"ROLE_SUBSCRIPTIONS_ENABLED",
Expand Down Expand Up @@ -2863,6 +2868,7 @@ declare namespace Dysnomia {
publicUpdatesChannelID: string | null;
roles: Collection<Role>;
rulesChannelID: string | null;
safetyAlertsChannelID: string | null;
shard: Shard;
splash: string | null;
splashURL: 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 @@ -1387,6 +1387,7 @@ class Client extends EventEmitter {
* @arg {Boolean} [options.premiumProgressBarEnabled] If the boost progress bar is enabled
* @arg {String} [options.publicUpdatesChannelID] The id of the channel where admins and moderators of "COMMUNITY" guilds receive notices from Discord
* @arg {String} [options.rulesChannelID] The id of the channel where "COMMUNITY" guilds display rules and/or guidelines
* @arg {String} [options.safetyAlertsChannelID] The ID of the channel where safety alerts from Discord are received
* @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
Expand Down Expand Up @@ -1415,6 +1416,7 @@ class Client extends EventEmitter {
discovery_splash: options.discoverySplash,
features: options.features,
premium_progress_bar_enabled: options.premiumProgressBarEnabled,
safety_alerts_channel_id: options.safetyAlertsChannelID,
reason: reason
}).then((guild) => new Guild(guild, this));
}
Expand Down
1 change: 1 addition & 0 deletions lib/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ module.exports.GuildFeatures = [
"NEWS",
"PARTNERED",
"PREVIEW_ENABLED",
"RAID_ALERTS_DISABLED",
"ROLE_ICONS",
"ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE",
"ROLE_SUBSCRIPTIONS_ENABLED",
Expand Down
2 changes: 2 additions & 0 deletions lib/gateway/Shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,7 @@ class Shard extends EventEmitter {
premiumTier: guild.premiumTier,
publicUpdatesChannelID: guild.publicUpdatesChannelID,
rulesChannelID: guild.rulesChannelID,
safetyAlertsChannelID: guild.safetyAlertsChannelID,
splash: guild.splash,
stickers: guild.stickers,
systemChannelFlags: guild.systemChannelFlags,
Expand Down Expand Up @@ -1265,6 +1266,7 @@ class Shard extends EventEmitter {
* @prop {Number} oldGuild.premiumTier Nitro boost level of the guild
* @prop {String?} oldGuild.publicUpdatesChannelID ID of the guild's updates channel if the guild has "COMMUNITY" features
* @prop {String?} oldGuild.rulesChannelID The channel where "COMMUNITY" guilds display rules and/or guidelines
* @prop {String?} oldGuild.safetyAlertsChannelID The ID of the channel where safety alerts from Discord are received
* @prop {String?} oldGuild.splash The hash of the guild splash image, or null if no splash (VIP only)
* @prop {Array<Object>?} stickers An array of guild sticker objects
* @prop {Number} oldGuild.systemChannelFlags the flags for the system channel
Expand Down
4 changes: 4 additions & 0 deletions lib/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const ThreadChannel = require("./ThreadChannel");
* @prop {String?} publicUpdatesChannelID ID of the guild's updates channel if the guild has "COMMUNITY" features
* @prop {Collection<Role>} roles Collection of Roles in the guild
* @prop {String?} rulesChannelID The channel where "COMMUNITY" guilds display rules and/or guidelines
* @prop {String?} safetyAlertsChannelID The ID of the channel where safety alerts from Discord are received
* @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
Expand Down Expand Up @@ -294,6 +295,9 @@ class Guild extends Base {
if(data.nsfw_level !== undefined) {
this.nsfwLevel = data.nsfw_level;
}
if(data.safety_alerts_channel_id !== undefined) {
this.safetyAlertsChannelID = data.safety_alerts_channel_id;
}
}

get bannerURL() {
Expand Down