feat: user guild tags (#1287)

This commit is contained in:
Danial Raza
2025-07-02 11:39:15 +02:00
committed by GitHub
parent b238cc5b67
commit 3245f7de92
8 changed files with 168 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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;
}

11
deno/rest/v10/mod.ts generated
View File

@@ -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<Format extends GuildTagBadgeFormat>(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<ImageFormat, ImageFormat.GIF | ImageFormat.L
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildTagBadgeFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
/**
* @deprecated Use {@link DefaultUserAvatarFormat} instead.

11
deno/rest/v9/mod.ts generated
View File

@@ -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<Format extends GuildTagBadgeFormat>(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<ImageFormat, ImageFormat.GIF | ImageFormat.L
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildTagBadgeFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
/**
* @deprecated Use {@link DefaultUserAvatarFormat} instead.

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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<Format extends GuildTagBadgeFormat>(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<ImageFormat, ImageFormat.GIF | ImageFormat.L
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildTagBadgeFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
/**
* @deprecated Use {@link DefaultUserAvatarFormat} instead.

View File

@@ -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<Format extends GuildTagBadgeFormat>(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<ImageFormat, ImageFormat.GIF | ImageFormat.L
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildTagBadgeFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
/**
* @deprecated Use {@link DefaultUserAvatarFormat} instead.