diff --git a/packages/formatters/__tests__/formatters.test.ts b/packages/formatters/__tests__/formatters.test.ts index 1b745439943d..c91f4c694348 100644 --- a/packages/formatters/__tests__/formatters.test.ts +++ b/packages/formatters/__tests__/formatters.test.ts @@ -174,31 +174,37 @@ describe('Message formatters', () => { }); describe('formatEmoji', () => { - test('GIVEN static emojiId THEN returns "<:_:${emojiId}>"', () => { - expect<`<:_:851461487498493952>`>(formatEmoji('851461487498493952')).toEqual('<:_:851461487498493952>'); + test('GIVEN static emojiId THEN returns "<:emoji:${emojiId}>"', () => { + expect<`<:emoji:851461487498493952>`>(formatEmoji('851461487498493952')).toEqual('<:emoji:851461487498493952>'); }); - test('GIVEN static emojiId WITH animated explicitly false THEN returns "<:_:[emojiId]>"', () => { - expect<`<:_:851461487498493952>`>(formatEmoji('851461487498493952', false)).toEqual('<:_:851461487498493952>'); + test('GIVEN static emojiId WITH animated explicitly false THEN returns "<:emoji:[emojiId]>"', () => { + expect<`<:emoji:851461487498493952>`>(formatEmoji('851461487498493952', false)).toEqual( + '<:emoji:851461487498493952>', + ); }); - test('GIVEN animated emojiId THEN returns ""', () => { - expect<``>(formatEmoji('827220205352255549', true)).toEqual(''); + test('GIVEN animated emojiId THEN returns ""', () => { + expect<``>(formatEmoji('827220205352255549', true)).toEqual( + '', + ); }); - test('GIVEN static id in options object THEN returns "<:_:${id}>"', () => { - expect<`<:_:851461487498493952>`>(formatEmoji({ id: '851461487498493952' })).toEqual('<:_:851461487498493952>'); + test('GIVEN static id in options object THEN returns "<:emoji:${id}>"', () => { + expect<`<:emoji:851461487498493952>`>(formatEmoji({ id: '851461487498493952' })).toEqual( + '<:emoji:851461487498493952>', + ); }); - test('GIVEN static id in options object WITH animated explicitly false THEN returns "<:_:${id}>"', () => { - expect<`<:_:851461487498493952>`>(formatEmoji({ animated: false, id: '851461487498493952' })).toEqual( - '<:_:851461487498493952>', + test('GIVEN static id in options object WITH animated explicitly false THEN returns "<:emoji:${id}>"', () => { + expect<`<:emoji:851461487498493952>`>(formatEmoji({ animated: false, id: '851461487498493952' })).toEqual( + '<:emoji:851461487498493952>', ); }); - test('GIVEN animated id in options object THEN returns ""', () => { - expect<``>(formatEmoji({ animated: true, id: '827220205352255549' })).toEqual( - '', + test('GIVEN animated id in options object THEN returns ""', () => { + expect<``>(formatEmoji({ animated: true, id: '827220205352255549' })).toEqual( + '', ); }); diff --git a/packages/formatters/src/formatters.ts b/packages/formatters/src/formatters.ts index 9c4e11932949..915ec331c816 100644 --- a/packages/formatters/src/formatters.ts +++ b/packages/formatters/src/formatters.ts @@ -323,7 +323,7 @@ export function chatInputApplicationCommandMention< * @typeParam EmojiId - This is inferred by the supplied emoji id * @param emojiId - The emoji id to format */ -export function formatEmoji(emojiId: EmojiId, animated?: false): `<:_:${EmojiId}>`; +export function formatEmoji(emojiId: EmojiId, animated?: false): `<:emoji:${EmojiId}>`; /** * Formats an animated emoji id into a fully qualified emoji identifier. @@ -332,7 +332,7 @@ export function formatEmoji(emojiId: EmojiId, animate * @param emojiId - The emoji id to format * @param animated - Whether the emoji is animated */ -export function formatEmoji(emojiId: EmojiId, animated?: true): ``; +export function formatEmoji(emojiId: EmojiId, animated?: true): ``; /** * Formats an emoji id into a fully qualified emoji identifier. @@ -344,7 +344,7 @@ export function formatEmoji(emojiId: EmojiId, animate export function formatEmoji( emojiId: EmojiId, animated?: boolean, -): `<:_:${EmojiId}>` | ``; +): `<:emoji:${EmojiId}>` | ``; /** * Formats a non-animated emoji id and name into a fully qualified emoji identifier. @@ -393,7 +393,7 @@ export function formatEmoji const { id, animated: isAnimated, name: emojiName } = options; - return `<${isAnimated ? 'a' : ''}:${emojiName ?? '_'}:${id}>`; + return `<${isAnimated ? 'a' : ''}:${emojiName ?? 'emoji'}:${id}>`; } /**