feat(formatters): add gameProfileMention() (#11612)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Almeida
2026-09-06 11:08:01 +00:00
committed by GitHub
co-authored by kodiakhq[bot]
parent 096177189f
commit 5f6cbf111e
2 changed files with 17 additions and 0 deletions
@@ -10,6 +10,7 @@ import {
codeBlock,
Faces,
formatEmoji,
gameProfileMention,
heading,
HeadingLevel,
hideLinkEmbed,
@@ -153,6 +154,12 @@ describe('Message formatters', () => {
});
});
describe('gameProfileMention', () => {
test('GIVEN gameId THEN returns "<@$[gameId]>"', () => {
expect<'<@$1402418491272986635>'>(gameProfileMention('1402418491272986635')).toEqual('<@$1402418491272986635>');
});
});
describe('chatInputApplicationCommandMention', () => {
test('GIVEN commandId and commandName THEN returns "</[commandName]:[commandId]>"', () => {
expect(chatInputApplicationCommandMention('815434166602170409', 'airhorn')).toEqual(
+10
View File
@@ -223,6 +223,16 @@ export function linkedRoleMention<RoleId extends Snowflake>(roleId: RoleId): `<i
return `<id:linked-roles:${roleId}>`;
}
/**
* Formats a game id into a game profile mention.
*
* @typeParam GameId - This is inferred by the supplied game id
* @param gameId - The game id to format
*/
export function gameProfileMention<GameId extends Snowflake>(gameId: GameId): `<@$${GameId}>` {
return `<@$${gameId}>`;
}
/**
* Formats an application command name and id into an application command mention.
*