Skip to content

Commit 3245f7d

Browse files
authored
feat: user guild tags (#1287)
1 parent b238cc5 commit 3245f7d

File tree

8 files changed

+168
-0
lines changed

8 files changed

+168
-0
lines changed

deno/payloads/v10/user.ts

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/payloads/v9/user.ts

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/rest/v10/mod.ts

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/rest/v9/mod.ts

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

payloads/v10/user.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ export interface APIUser {
102102
* @see {@link https://discord.com/developers/docs/resources/user#collectibles}
103103
*/
104104
collectibles?: APICollectibles | null;
105+
/**
106+
* The user's primary guild
107+
*
108+
* @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild}
109+
*/
110+
primary_guild?: APIUserPrimaryGuild | null;
105111
}
106112

107113
/**
@@ -407,3 +413,28 @@ export enum NameplatePalette {
407413
Violet = 'violet',
408414
White = 'white',
409415
}
416+
417+
/**
418+
* @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild}
419+
*/
420+
export interface APIUserPrimaryGuild {
421+
/**
422+
* The id of the user's primary guild
423+
*/
424+
identity_guild_id: Snowflake | null;
425+
/**
426+
* Whether the user is displaying the primary guild's server tag.
427+
* This can be `null` if the system clears the identity, e.g. because the server no longer supports tags
428+
*/
429+
identity_enabled: boolean | null;
430+
/**
431+
* The text of the user's server tag. Limited to 4 characters
432+
*/
433+
tag: string | null;
434+
/**
435+
* The server tag badge hash
436+
*
437+
* @see {@link https://discord.com/developers/docs/reference#image-formatting}
438+
*/
439+
badge: string | null;
440+
}

payloads/v9/user.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ export interface APIUser {
102102
* @see {@link https://discord.com/developers/docs/resources/user#collectibles}
103103
*/
104104
collectibles?: APICollectibles | null;
105+
/**
106+
* The user's primary guild
107+
*
108+
* @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild}
109+
*/
110+
primary_guild?: APIUserPrimaryGuild | null;
105111
}
106112

107113
/**
@@ -407,3 +413,28 @@ export enum NameplatePalette {
407413
Violet = 'violet',
408414
White = 'white',
409415
}
416+
417+
/**
418+
* @see {@link https://discord.com/developers/docs/resources/user#user-object-user-primary-guild}
419+
*/
420+
export interface APIUserPrimaryGuild {
421+
/**
422+
* The id of the user's primary guild
423+
*/
424+
identity_guild_id: Snowflake | null;
425+
/**
426+
* Whether the user is displaying the primary guild's server tag.
427+
* This can be `null` if the system clears the identity, e.g. because the server no longer supports tags
428+
*/
429+
identity_enabled: boolean | null;
430+
/**
431+
* The text of the user's server tag. Limited to 4 characters
432+
*/
433+
tag: string | null;
434+
/**
435+
* The server tag badge hash
436+
*
437+
* @see {@link https://discord.com/developers/docs/reference#image-formatting}
438+
*/
439+
badge: string | null;
440+
}

rest/v10/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,16 @@ export const CDNRoutes = {
14031403
soundboardSound(soundId: Snowflake) {
14041404
return `/soundboard-sounds/${soundId}` as const;
14051405
},
1406+
1407+
/**
1408+
* Route for:
1409+
* - GET `/clan-badges/{guild.id}/{badge}.{png|jpeg|webp}`
1410+
*
1411+
* This route supports the extensions: PNG, JPEG, WebP
1412+
*/
1413+
guildTagBadge<Format extends GuildTagBadgeFormat>(guildId: Snowflake, guildTagBadge: string, format: Format) {
1414+
return `/clan-badges/${guildId}/${guildTagBadge}.${format}` as const;
1415+
},
14061416
};
14071417

14081418
for (const [key, fn] of Object.entries(CDNRoutes)) {
@@ -1449,6 +1459,7 @@ export type StickerFormat = Extract<ImageFormat, ImageFormat.GIF | ImageFormat.L
14491459
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
14501460
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
14511461
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
1462+
export type GuildTagBadgeFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
14521463

14531464
/**
14541465
* @deprecated Use {@link DefaultUserAvatarFormat} instead.

rest/v9/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,16 @@ export const CDNRoutes = {
14121412
soundboardSound(soundId: Snowflake) {
14131413
return `/soundboard-sounds/${soundId}` as const;
14141414
},
1415+
1416+
/**
1417+
* Route for:
1418+
* - GET `/clan-badges/{guild.id}/{badge}.{png|jpeg|webp}`
1419+
*
1420+
* This route supports the extensions: PNG, JPEG, WebP
1421+
*/
1422+
guildTagBadge<Format extends GuildTagBadgeFormat>(guildId: Snowflake, guildTagBadge: string, format: Format) {
1423+
return `/clan-badges/${guildId}/${guildTagBadge}.${format}` as const;
1424+
},
14151425
};
14161426

14171427
for (const [key, fn] of Object.entries(CDNRoutes)) {
@@ -1458,6 +1468,7 @@ export type StickerFormat = Extract<ImageFormat, ImageFormat.GIF | ImageFormat.L
14581468
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
14591469
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
14601470
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
1471+
export type GuildTagBadgeFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
14611472

14621473
/**
14631474
* @deprecated Use {@link DefaultUserAvatarFormat} instead.

0 commit comments

Comments
 (0)