feat: user tags (#4238)

* feat: user tags

* Apply suggestions from code review

Co-authored-by: Link <lts20050703@gmail.com>

---------

Co-authored-by: Link <lts20050703@gmail.com>
This commit is contained in:
Fleny
2025-07-12 09:25:31 +02:00
committed by GitHub
co-authored by Link
parent 8e637731e8
commit cb8176c623
6 changed files with 86 additions and 4 deletions
+21
View File
@@ -447,3 +447,24 @@ export function roleIconUrl(
)
: undefined
}
/**
* Builds the URL to a guild tag badge stored in the Discord CDN.
*
* @param guildId - The ID of the guild to get the tag badge of
* @param badgeHash - The hash identifying the guild tag badge.
* @param options - The parameters for the building of the URL.
* @returns The link to the resource or `undefined` if no badge has been set.
*/
export function guildTagBadgeUrl(
guildId: BigString,
badgeHash: BigString | undefined,
options?: {
size?: ImageSize
format?: ImageFormat
},
): string | undefined {
if (badgeHash === undefined) return undefined
return formatImageUrl(`https://cdn.discordapp.com/guild-tag-badges/${guildId}/${badgeHash}`, options?.size ?? 128, options?.format)
}