mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user