diff --git a/packages/formatters/__tests__/formatters.test.ts b/packages/formatters/__tests__/formatters.test.ts index dd6475882..c0ed8fdd1 100644 --- a/packages/formatters/__tests__/formatters.test.ts +++ b/packages/formatters/__tests__/formatters.test.ts @@ -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 ""', () => { expect(chatInputApplicationCommandMention('815434166602170409', 'airhorn')).toEqual( diff --git a/packages/formatters/src/formatters.ts b/packages/formatters/src/formatters.ts index 9ffebee0c..e1103956d 100644 --- a/packages/formatters/src/formatters.ts +++ b/packages/formatters/src/formatters.ts @@ -223,6 +223,16 @@ export function linkedRoleMention(roleId: 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: GameId): `<@$${GameId}>` { + return `<@$${gameId}>`; +} + /** * Formats an application command name and id into an application command mention. *