Skip to content

Commit

Permalink
feat(Guild): add join raid and mention raid protection (#677)
Browse files Browse the repository at this point in the history
Co-authored-by: Vlad Frangu <[email protected]>
  • Loading branch information
advaith1 and vladfrangu authored Jun 27, 2023
1 parent 374f690 commit 844ad56
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 0 deletions.
5 changes: 5 additions & 0 deletions deno/payloads/v10/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ export type APIAuditLogChangeKeyRulesChannelId = AuditLogChangeData<'rules_chann
*/
export type APIAuditLogChangeKeyPublicUpdatesChannelId = AuditLogChangeData<'public_updates_channel_id', string>;

/**
* Returned when a guild's safety_alerts_channel_id is changed
*/
export type APIAuditLogChangeKeySafetyAlertsChannelId = AuditLogChangeData<'safety_alerts_channel_id', string>;

/**
* Returned when a guild's mfa_level is changed
*/
Expand Down
6 changes: 6 additions & 0 deletions deno/payloads/v10/autoModeration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ export interface APIAutoModerationRuleTriggerMetadata {
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
*/
mention_total_limit?: number;
/**
* Whether to automatically detect mention raids
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
*/
mention_raid_protection_enabled?: boolean;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions deno/payloads/v10/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ export interface APIGuild extends APIPartialGuild {
* The type of Student Hub the guild is
*/
hub_type: GuildHubType | null;
/**
* The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord
*/
safety_alerts_channel_id: Snowflake | null;
}

/**
Expand Down Expand Up @@ -493,6 +497,10 @@ export enum GuildFeature {
* Guild has access to create private threads
*/
PrivateThreads = 'PRIVATE_THREADS',
/**
* Guild has disabled alerts for join raids in the configured safety alerts channel
*/
RaidAlertsDisabled = 'RAID_ALERTS_DISABLED',
RelayEnabled = 'RELAY_ENABLED',
/**
* Guild is able to set role icons
Expand Down
5 changes: 5 additions & 0 deletions deno/payloads/v9/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ export type APIAuditLogChangeKeyRulesChannelId = AuditLogChangeData<'rules_chann
*/
export type APIAuditLogChangeKeyPublicUpdatesChannelId = AuditLogChangeData<'public_updates_channel_id', string>;

/**
* Returned when a guild's safety_alerts_channel_id is changed
*/
export type APIAuditLogChangeKeySafetyAlertsChannelId = AuditLogChangeData<'safety_alerts_channel_id', string>;

/**
* Returned when a guild's mfa_level is changed
*/
Expand Down
6 changes: 6 additions & 0 deletions deno/payloads/v9/autoModeration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ export interface APIAutoModerationRuleTriggerMetadata {
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
*/
mention_total_limit?: number;
/**
* Whether to automatically detect mention raids
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
*/
mention_raid_protection_enabled?: boolean;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions deno/payloads/v9/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ export interface APIGuild extends APIPartialGuild {
* The type of Student Hub the guild is
*/
hub_type: GuildHubType | null;
/**
* The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord
*/
safety_alerts_channel_id: Snowflake | null;
}

/**
Expand Down Expand Up @@ -485,6 +489,10 @@ export enum GuildFeature {
* Guild has access to create private threads
*/
PrivateThreads = 'PRIVATE_THREADS',
/**
* Guild has disabled alerts for join raids in the configured safety alerts channel
*/
RaidAlertsDisabled = 'RAID_ALERTS_DISABLED',
RelayEnabled = 'RELAY_ENABLED',
/**
* Guild is able to set role icons
Expand Down
4 changes: 4 additions & 0 deletions deno/rest/v10/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ export interface RESTPatchAPIGuildJSONBody {
* Whether the boosts progress bar should be enabled.
*/
premium_progress_bar_enabled?: boolean | undefined;
/**
* The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord
*/
safety_alerts_channel_id?: Snowflake | null | undefined;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions deno/rest/v9/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ export interface RESTPatchAPIGuildJSONBody {
* Whether the boosts progress bar should be enabled.
*/
premium_progress_bar_enabled?: boolean | undefined;
/**
* The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord
*/
safety_alerts_channel_id?: Snowflake | null | undefined;
}

/**
Expand Down
5 changes: 5 additions & 0 deletions payloads/v10/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ export type APIAuditLogChangeKeyRulesChannelId = AuditLogChangeData<'rules_chann
*/
export type APIAuditLogChangeKeyPublicUpdatesChannelId = AuditLogChangeData<'public_updates_channel_id', string>;

/**
* Returned when a guild's safety_alerts_channel_id is changed
*/
export type APIAuditLogChangeKeySafetyAlertsChannelId = AuditLogChangeData<'safety_alerts_channel_id', string>;

/**
* Returned when a guild's mfa_level is changed
*/
Expand Down
6 changes: 6 additions & 0 deletions payloads/v10/autoModeration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ export interface APIAutoModerationRuleTriggerMetadata {
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
*/
mention_total_limit?: number;
/**
* Whether to automatically detect mention raids
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
*/
mention_raid_protection_enabled?: boolean;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions payloads/v10/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ export interface APIGuild extends APIPartialGuild {
* The type of Student Hub the guild is
*/
hub_type: GuildHubType | null;
/**
* The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord
*/
safety_alerts_channel_id: Snowflake | null;
}

/**
Expand Down Expand Up @@ -493,6 +497,10 @@ export enum GuildFeature {
* Guild has access to create private threads
*/
PrivateThreads = 'PRIVATE_THREADS',
/**
* Guild has disabled alerts for join raids in the configured safety alerts channel
*/
RaidAlertsDisabled = 'RAID_ALERTS_DISABLED',
RelayEnabled = 'RELAY_ENABLED',
/**
* Guild is able to set role icons
Expand Down
5 changes: 5 additions & 0 deletions payloads/v9/auditLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ export type APIAuditLogChangeKeyRulesChannelId = AuditLogChangeData<'rules_chann
*/
export type APIAuditLogChangeKeyPublicUpdatesChannelId = AuditLogChangeData<'public_updates_channel_id', string>;

/**
* Returned when a guild's safety_alerts_channel_id is changed
*/
export type APIAuditLogChangeKeySafetyAlertsChannelId = AuditLogChangeData<'safety_alerts_channel_id', string>;

/**
* Returned when a guild's mfa_level is changed
*/
Expand Down
6 changes: 6 additions & 0 deletions payloads/v9/autoModeration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ export interface APIAutoModerationRuleTriggerMetadata {
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
*/
mention_total_limit?: number;
/**
* Whether to automatically detect mention raids
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
*/
mention_raid_protection_enabled?: boolean;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions payloads/v9/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ export interface APIGuild extends APIPartialGuild {
* The type of Student Hub the guild is
*/
hub_type: GuildHubType | null;
/**
* The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord
*/
safety_alerts_channel_id: Snowflake | null;
}

/**
Expand Down Expand Up @@ -485,6 +489,10 @@ export enum GuildFeature {
* Guild has access to create private threads
*/
PrivateThreads = 'PRIVATE_THREADS',
/**
* Guild has disabled alerts for join raids in the configured safety alerts channel
*/
RaidAlertsDisabled = 'RAID_ALERTS_DISABLED',
RelayEnabled = 'RELAY_ENABLED',
/**
* Guild is able to set role icons
Expand Down
4 changes: 4 additions & 0 deletions rest/v10/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ export interface RESTPatchAPIGuildJSONBody {
* Whether the boosts progress bar should be enabled.
*/
premium_progress_bar_enabled?: boolean | undefined;
/**
* The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord
*/
safety_alerts_channel_id?: Snowflake | null | undefined;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions rest/v9/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ export interface RESTPatchAPIGuildJSONBody {
* Whether the boosts progress bar should be enabled.
*/
premium_progress_bar_enabled?: boolean | undefined;
/**
* The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord
*/
safety_alerts_channel_id?: Snowflake | null | undefined;
}

/**
Expand Down

1 comment on commit 844ad56

@vercel
Copy link

@vercel vercel bot commented on 844ad56 Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.