diff --git a/deno/payloads/v10/user.ts b/deno/payloads/v10/user.ts index 76883dac..54ad44f4 100644 --- a/deno/payloads/v10/user.ts +++ b/deno/payloads/v10/user.ts @@ -102,6 +102,12 @@ export interface APIUser { * @see {@link https://discord.com/developers/docs/resources/user#collectibles} */ collectibles?: APICollectibles | null; + /** + * The user's primary guild + * + * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild} + */ + primary_guild?: APIUserPrimaryGuild | null; } /** @@ -407,3 +413,28 @@ export enum NameplatePalette { Violet = 'violet', White = 'white', } + +/** + * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild} + */ +export interface APIUserPrimaryGuild { + /** + * The id of the user's primary guild + */ + identity_guild_id: Snowflake | null; + /** + * Whether the user is displaying the primary guild's server tag. + * This can be `null` if the system clears the identity, e.g. because the server no longer supports tags + */ + identity_enabled: boolean | null; + /** + * The text of the user's server tag. Limited to 4 characters + */ + tag: string | null; + /** + * The server tag badge hash + * + * @see {@link https://discord.com/developers/docs/reference#image-formatting} + */ + badge: string | null; +} diff --git a/deno/payloads/v9/user.ts b/deno/payloads/v9/user.ts index 76883dac..54ad44f4 100644 --- a/deno/payloads/v9/user.ts +++ b/deno/payloads/v9/user.ts @@ -102,6 +102,12 @@ export interface APIUser { * @see {@link https://discord.com/developers/docs/resources/user#collectibles} */ collectibles?: APICollectibles | null; + /** + * The user's primary guild + * + * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild} + */ + primary_guild?: APIUserPrimaryGuild | null; } /** @@ -407,3 +413,28 @@ export enum NameplatePalette { Violet = 'violet', White = 'white', } + +/** + * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild} + */ +export interface APIUserPrimaryGuild { + /** + * The id of the user's primary guild + */ + identity_guild_id: Snowflake | null; + /** + * Whether the user is displaying the primary guild's server tag. + * This can be `null` if the system clears the identity, e.g. because the server no longer supports tags + */ + identity_enabled: boolean | null; + /** + * The text of the user's server tag. Limited to 4 characters + */ + tag: string | null; + /** + * The server tag badge hash + * + * @see {@link https://discord.com/developers/docs/reference#image-formatting} + */ + badge: string | null; +} diff --git a/deno/rest/v10/mod.ts b/deno/rest/v10/mod.ts index 715e1706..4bec9077 100644 --- a/deno/rest/v10/mod.ts +++ b/deno/rest/v10/mod.ts @@ -1403,6 +1403,16 @@ export const CDNRoutes = { soundboardSound(soundId: Snowflake) { return `/soundboard-sounds/${soundId}` as const; }, + + /** + * Route for: + * - GET `/clan-badges/{guild.id}/{badge}.{png|jpeg|webp}` + * + * This route supports the extensions: PNG, JPEG, WebP + */ + guildTagBadge(guildId: Snowflake, guildTagBadge: string, format: Format) { + return `/clan-badges/${guildId}/${guildTagBadge}.${format}` as const; + }, }; for (const [key, fn] of Object.entries(CDNRoutes)) { @@ -1449,6 +1459,7 @@ export type StickerFormat = Extract; export type GuildScheduledEventCoverFormat = Exclude; export type GuildMemberBannerFormat = Exclude; +export type GuildTagBadgeFormat = Exclude; /** * @deprecated Use {@link DefaultUserAvatarFormat} instead. diff --git a/deno/rest/v9/mod.ts b/deno/rest/v9/mod.ts index 22ad03d2..d8e8d471 100644 --- a/deno/rest/v9/mod.ts +++ b/deno/rest/v9/mod.ts @@ -1412,6 +1412,16 @@ export const CDNRoutes = { soundboardSound(soundId: Snowflake) { return `/soundboard-sounds/${soundId}` as const; }, + + /** + * Route for: + * - GET `/clan-badges/{guild.id}/{badge}.{png|jpeg|webp}` + * + * This route supports the extensions: PNG, JPEG, WebP + */ + guildTagBadge(guildId: Snowflake, guildTagBadge: string, format: Format) { + return `/clan-badges/${guildId}/${guildTagBadge}.${format}` as const; + }, }; for (const [key, fn] of Object.entries(CDNRoutes)) { @@ -1458,6 +1468,7 @@ export type StickerFormat = Extract; export type GuildScheduledEventCoverFormat = Exclude; export type GuildMemberBannerFormat = Exclude; +export type GuildTagBadgeFormat = Exclude; /** * @deprecated Use {@link DefaultUserAvatarFormat} instead. diff --git a/payloads/v10/user.ts b/payloads/v10/user.ts index 9707675a..dc88e111 100644 --- a/payloads/v10/user.ts +++ b/payloads/v10/user.ts @@ -102,6 +102,12 @@ export interface APIUser { * @see {@link https://discord.com/developers/docs/resources/user#collectibles} */ collectibles?: APICollectibles | null; + /** + * The user's primary guild + * + * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild} + */ + primary_guild?: APIUserPrimaryGuild | null; } /** @@ -407,3 +413,28 @@ export enum NameplatePalette { Violet = 'violet', White = 'white', } + +/** + * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild} + */ +export interface APIUserPrimaryGuild { + /** + * The id of the user's primary guild + */ + identity_guild_id: Snowflake | null; + /** + * Whether the user is displaying the primary guild's server tag. + * This can be `null` if the system clears the identity, e.g. because the server no longer supports tags + */ + identity_enabled: boolean | null; + /** + * The text of the user's server tag. Limited to 4 characters + */ + tag: string | null; + /** + * The server tag badge hash + * + * @see {@link https://discord.com/developers/docs/reference#image-formatting} + */ + badge: string | null; +} diff --git a/payloads/v9/user.ts b/payloads/v9/user.ts index 9707675a..dc88e111 100644 --- a/payloads/v9/user.ts +++ b/payloads/v9/user.ts @@ -102,6 +102,12 @@ export interface APIUser { * @see {@link https://discord.com/developers/docs/resources/user#collectibles} */ collectibles?: APICollectibles | null; + /** + * The user's primary guild + * + * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild} + */ + primary_guild?: APIUserPrimaryGuild | null; } /** @@ -407,3 +413,28 @@ export enum NameplatePalette { Violet = 'violet', White = 'white', } + +/** + * @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild} + */ +export interface APIUserPrimaryGuild { + /** + * The id of the user's primary guild + */ + identity_guild_id: Snowflake | null; + /** + * Whether the user is displaying the primary guild's server tag. + * This can be `null` if the system clears the identity, e.g. because the server no longer supports tags + */ + identity_enabled: boolean | null; + /** + * The text of the user's server tag. Limited to 4 characters + */ + tag: string | null; + /** + * The server tag badge hash + * + * @see {@link https://discord.com/developers/docs/reference#image-formatting} + */ + badge: string | null; +} diff --git a/rest/v10/index.ts b/rest/v10/index.ts index 1022db73..abddda89 100644 --- a/rest/v10/index.ts +++ b/rest/v10/index.ts @@ -1403,6 +1403,16 @@ export const CDNRoutes = { soundboardSound(soundId: Snowflake) { return `/soundboard-sounds/${soundId}` as const; }, + + /** + * Route for: + * - GET `/clan-badges/{guild.id}/{badge}.{png|jpeg|webp}` + * + * This route supports the extensions: PNG, JPEG, WebP + */ + guildTagBadge(guildId: Snowflake, guildTagBadge: string, format: Format) { + return `/clan-badges/${guildId}/${guildTagBadge}.${format}` as const; + }, }; for (const [key, fn] of Object.entries(CDNRoutes)) { @@ -1449,6 +1459,7 @@ export type StickerFormat = Extract; export type GuildScheduledEventCoverFormat = Exclude; export type GuildMemberBannerFormat = Exclude; +export type GuildTagBadgeFormat = Exclude; /** * @deprecated Use {@link DefaultUserAvatarFormat} instead. diff --git a/rest/v9/index.ts b/rest/v9/index.ts index 740faef4..f5e8dc38 100644 --- a/rest/v9/index.ts +++ b/rest/v9/index.ts @@ -1412,6 +1412,16 @@ export const CDNRoutes = { soundboardSound(soundId: Snowflake) { return `/soundboard-sounds/${soundId}` as const; }, + + /** + * Route for: + * - GET `/clan-badges/{guild.id}/{badge}.{png|jpeg|webp}` + * + * This route supports the extensions: PNG, JPEG, WebP + */ + guildTagBadge(guildId: Snowflake, guildTagBadge: string, format: Format) { + return `/clan-badges/${guildId}/${guildTagBadge}.${format}` as const; + }, }; for (const [key, fn] of Object.entries(CDNRoutes)) { @@ -1458,6 +1468,7 @@ export type StickerFormat = Extract; export type GuildScheduledEventCoverFormat = Exclude; export type GuildMemberBannerFormat = Exclude; +export type GuildTagBadgeFormat = Exclude; /** * @deprecated Use {@link DefaultUserAvatarFormat} instead.