From 8fe9c072b3188c51bb3713dae640ba227a266438 Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Sat, 25 Jan 2025 20:16:48 +0100 Subject: [PATCH] feat(APIGuild): add `incidents_data` (#822) --- deno/payloads/v10/guild.ts | 23 +++++++++++++++++++++++ deno/payloads/v9/guild.ts | 23 +++++++++++++++++++++++ deno/rest/v10/guild.ts | 14 ++++++++++++++ deno/rest/v10/mod.ts | 8 ++++++++ deno/rest/v9/guild.ts | 14 ++++++++++++++ deno/rest/v9/mod.ts | 8 ++++++++ payloads/v10/guild.ts | 23 +++++++++++++++++++++++ payloads/v9/guild.ts | 23 +++++++++++++++++++++++ rest/v10/guild.ts | 14 ++++++++++++++ rest/v10/index.ts | 8 ++++++++ rest/v9/guild.ts | 14 ++++++++++++++ rest/v9/index.ts | 8 ++++++++ 12 files changed, 180 insertions(+) diff --git a/deno/payloads/v10/guild.ts b/deno/payloads/v10/guild.ts index aaf326f2..6d2b547a 100644 --- a/deno/payloads/v10/guild.ts +++ b/deno/payloads/v10/guild.ts @@ -281,6 +281,10 @@ export interface APIGuild extends APIPartialGuild { * The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord */ safety_alerts_channel_id: Snowflake | null; + /** + * The incidents data for this guild + */ + incidents_data: APIIncidentsData | null; } /** @@ -1160,3 +1164,22 @@ export enum GuildOnboardingPromptType { MultipleChoice, Dropdown, } + +export interface APIIncidentsData { + /** + * When invites get enabled again + */ + invites_disabled_until: string | null; + /** + * When direct messages get enabled again + */ + dms_disabled_until: string | null; + /** + * When the dm spam was detected + */ + dm_spam_detected_at?: string | null; + /** + * When the raid was detected + */ + raid_detected_at?: string | null; +} diff --git a/deno/payloads/v9/guild.ts b/deno/payloads/v9/guild.ts index a3b10e2a..49dd2d4b 100644 --- a/deno/payloads/v9/guild.ts +++ b/deno/payloads/v9/guild.ts @@ -281,6 +281,10 @@ export interface APIGuild extends APIPartialGuild { * The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord */ safety_alerts_channel_id: Snowflake | null; + /** + * The incidents data for this guild + */ + incidents_data: APIIncidentsData | null; } /** @@ -1152,3 +1156,22 @@ export enum GuildOnboardingPromptType { MultipleChoice, Dropdown, } + +export interface APIIncidentsData { + /** + * When invites get enabled again + */ + invites_disabled_until: string | null; + /** + * When direct messages get enabled again + */ + dms_disabled_until: string | null; + /** + * When the dm spam was detected + */ + dm_spam_detected_at?: string | null; + /** + * When the raid was detected + */ + raid_detected_at?: string | null; +} diff --git a/deno/rest/v10/guild.ts b/deno/rest/v10/guild.ts index 2739f716..1e34d89f 100644 --- a/deno/rest/v10/guild.ts +++ b/deno/rest/v10/guild.ts @@ -997,3 +997,17 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardin * https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */ export type RESTPutAPIGuildOnboardingResult = APIGuildOnboarding; + +/** + * https://discord.com/developers/docs/resources/guild#modify-incidents-actions + */ +export interface RESTPutAPIGuildIncidentActionsJSONBody { + /** + * When invites will be enabled again + */ + invites_disabled_until?: string | undefined; + /** + * When direct messages will be enabled again + */ + dms_disabled_until?: string | undefined; +} diff --git a/deno/rest/v10/mod.ts b/deno/rest/v10/mod.ts index 7a8f086a..460086b1 100644 --- a/deno/rest/v10/mod.ts +++ b/deno/rest/v10/mod.ts @@ -933,6 +933,14 @@ export const Routes = { return `/guilds/${guildId}/onboarding` as const; }, + /** + * Route for: + * - PUT `/guilds/${guild.id}/incident-actions` + */ + guildIncidentActions(guildId: Snowflake) { + return `/guilds/${guildId}/incident-actions` as const; + }, + /** * Route for: * - GET `/applications/@me` diff --git a/deno/rest/v9/guild.ts b/deno/rest/v9/guild.ts index f7499b57..68d90a59 100644 --- a/deno/rest/v9/guild.ts +++ b/deno/rest/v9/guild.ts @@ -1003,3 +1003,17 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardin * https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */ export type RESTPutAPIGuildOnboardingResult = APIGuildOnboarding; + +/** + * https://discord.com/developers/docs/resources/guild#modify-incidents-actions + */ +export interface RESTPutAPIGuildIncidentActionsJSONBody { + /** + * When invites will be enabled again + */ + invites_disabled_until?: string | undefined; + /** + * When direct messages will be enabled again + */ + dms_disabled_until?: string | undefined; +} diff --git a/deno/rest/v9/mod.ts b/deno/rest/v9/mod.ts index 44be90d1..97768008 100644 --- a/deno/rest/v9/mod.ts +++ b/deno/rest/v9/mod.ts @@ -942,6 +942,14 @@ export const Routes = { return `/guilds/${guildId}/onboarding` as const; }, + /** + * Route for: + * - PUT `/guilds/${guild.id}/incident-actions` + */ + guildIncidentActions(guildId: Snowflake) { + return `/guilds/${guildId}/incident-actions` as const; + }, + /** * Route for: * - GET `/applications/@me` diff --git a/payloads/v10/guild.ts b/payloads/v10/guild.ts index 834769f9..e49fc46a 100644 --- a/payloads/v10/guild.ts +++ b/payloads/v10/guild.ts @@ -281,6 +281,10 @@ export interface APIGuild extends APIPartialGuild { * The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord */ safety_alerts_channel_id: Snowflake | null; + /** + * The incidents data for this guild + */ + incidents_data: APIIncidentsData | null; } /** @@ -1160,3 +1164,22 @@ export enum GuildOnboardingPromptType { MultipleChoice, Dropdown, } + +export interface APIIncidentsData { + /** + * When invites get enabled again + */ + invites_disabled_until: string | null; + /** + * When direct messages get enabled again + */ + dms_disabled_until: string | null; + /** + * When the dm spam was detected + */ + dm_spam_detected_at?: string | null; + /** + * When the raid was detected + */ + raid_detected_at?: string | null; +} diff --git a/payloads/v9/guild.ts b/payloads/v9/guild.ts index eaf02260..f363c839 100644 --- a/payloads/v9/guild.ts +++ b/payloads/v9/guild.ts @@ -281,6 +281,10 @@ export interface APIGuild extends APIPartialGuild { * The id of the channel where admins and moderators of Community guilds receive safety alerts from Discord */ safety_alerts_channel_id: Snowflake | null; + /** + * The incidents data for this guild + */ + incidents_data: APIIncidentsData | null; } /** @@ -1152,3 +1156,22 @@ export enum GuildOnboardingPromptType { MultipleChoice, Dropdown, } + +export interface APIIncidentsData { + /** + * When invites get enabled again + */ + invites_disabled_until: string | null; + /** + * When direct messages get enabled again + */ + dms_disabled_until: string | null; + /** + * When the dm spam was detected + */ + dm_spam_detected_at?: string | null; + /** + * When the raid was detected + */ + raid_detected_at?: string | null; +} diff --git a/rest/v10/guild.ts b/rest/v10/guild.ts index 53fc29ee..bb38138f 100644 --- a/rest/v10/guild.ts +++ b/rest/v10/guild.ts @@ -997,3 +997,17 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardin * https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */ export type RESTPutAPIGuildOnboardingResult = APIGuildOnboarding; + +/** + * https://discord.com/developers/docs/resources/guild#modify-incidents-actions + */ +export interface RESTPutAPIGuildIncidentActionsJSONBody { + /** + * When invites will be enabled again + */ + invites_disabled_until?: string | undefined; + /** + * When direct messages will be enabled again + */ + dms_disabled_until?: string | undefined; +} diff --git a/rest/v10/index.ts b/rest/v10/index.ts index ab10a509..703e3b9a 100644 --- a/rest/v10/index.ts +++ b/rest/v10/index.ts @@ -933,6 +933,14 @@ export const Routes = { return `/guilds/${guildId}/onboarding` as const; }, + /** + * Route for: + * - PUT `/guilds/${guild.id}/incident-actions` + */ + guildIncidentActions(guildId: Snowflake) { + return `/guilds/${guildId}/incident-actions` as const; + }, + /** * Route for: * - GET `/applications/@me` diff --git a/rest/v9/guild.ts b/rest/v9/guild.ts index ac8258ab..b2691d49 100644 --- a/rest/v9/guild.ts +++ b/rest/v9/guild.ts @@ -1003,3 +1003,17 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardin * https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */ export type RESTPutAPIGuildOnboardingResult = APIGuildOnboarding; + +/** + * https://discord.com/developers/docs/resources/guild#modify-incidents-actions + */ +export interface RESTPutAPIGuildIncidentActionsJSONBody { + /** + * When invites will be enabled again + */ + invites_disabled_until?: string | undefined; + /** + * When direct messages will be enabled again + */ + dms_disabled_until?: string | undefined; +} diff --git a/rest/v9/index.ts b/rest/v9/index.ts index 9e314a96..318cdc12 100644 --- a/rest/v9/index.ts +++ b/rest/v9/index.ts @@ -942,6 +942,14 @@ export const Routes = { return `/guilds/${guildId}/onboarding` as const; }, + /** + * Route for: + * - PUT `/guilds/${guild.id}/incident-actions` + */ + guildIncidentActions(guildId: Snowflake) { + return `/guilds/${guildId}/incident-actions` as const; + }, + /** * Route for: * - GET `/applications/@me`