@@ -20,7 +20,7 @@ export function codeBlock(language: string, content?: string): string {
20
20
}
21
21
22
22
/**
23
- * Wraps the content inside an inline code.
23
+ * Wraps the content inside \`backticks\`, which formats it as inline code.
24
24
* @param content The content to wrap.
25
25
* @returns The formatted content.
26
26
*/
@@ -56,7 +56,7 @@ export function underscore<C extends string>(content: C): `__${C}__` {
56
56
}
57
57
58
58
/**
59
- * Formats the content into strikethrough text.
59
+ * Formats the content into strike-through text.
60
60
* @param content The content to wrap.
61
61
* @returns The formatted content.
62
62
*/
@@ -83,14 +83,14 @@ export function blockQuote<C extends string>(content: C): `>>> ${C}` {
83
83
}
84
84
85
85
/**
86
- * Formats the URL into `<>`, which stops it from embedding.
86
+ * Wraps the URL into `<>`, which stops it from embedding.
87
87
* @param url The URL to wrap.
88
88
* @returns The formatted content.
89
89
*/
90
90
export function hideLinkEmbed < C extends string > ( url : C ) : `<${C } >`;
91
91
92
92
/**
93
- * Formats the URL into `<>`, which stops it from embedding.
93
+ * Wraps the URL into `<>`, which stops it from embedding.
94
94
* @param url The URL to wrap.
95
95
* @returns The formatted content.
96
96
*/
@@ -156,7 +156,7 @@ export function spoiler<C extends string>(content: C): `||${C}||` {
156
156
}
157
157
158
158
/**
159
- * Formats the user ID into a user mention.
159
+ * Formats a user ID into a user mention.
160
160
* @param userId The user ID to format.
161
161
* @returns The formatted user mention.
162
162
*/
@@ -165,7 +165,7 @@ export function userMention<C extends Snowflake>(userId: C): `<@${C}>` {
165
165
}
166
166
167
167
/**
168
- * Formats the user ID into a member-nickname mention.
168
+ * Formats a user ID into a member-nickname mention.
169
169
* @param memberId The user ID to format.
170
170
* @returns The formatted member-nickname mention.
171
171
*/
@@ -174,7 +174,7 @@ export function memberNicknameMention<C extends Snowflake>(memberId: C): `<@!${C
174
174
}
175
175
176
176
/**
177
- * Formats the channel ID into a channel mention.
177
+ * Formats a channel ID into a channel mention.
178
178
* @param channelId The channel ID to format.
179
179
* @returns The formatted channel mention.
180
180
*/
@@ -183,14 +183,39 @@ export function channelMention<C extends Snowflake>(channelId: C): `<#${C}>` {
183
183
}
184
184
185
185
/**
186
- * Formats the role ID into a role mention.
186
+ * Formats a role ID into a role mention.
187
187
* @param roleId The role ID to format.
188
188
* @returns The formatted role mention.
189
189
*/
190
190
export function roleMention < C extends Snowflake > ( roleId : C ) : `<@&${C } >` {
191
191
return `<@&${ roleId } >` ;
192
192
}
193
193
194
+ /**
195
+ * Formats an emoji ID into a fully qualified emoji identifier
196
+ * @param emojiId The emoji ID to format.
197
+ * @returns The formatted emoji.
198
+ */
199
+ export function formatEmoji < C extends Snowflake > ( emojiId : C , animated ?: false ) : `<:_:${C } >`;
200
+
201
+ /**
202
+ * Formats an emoji ID into a fully qualified emoji identifier
203
+ * @param emojiId The emoji ID to format.
204
+ * @param animated Whether the emoji is animated or not. Defaults to `false`
205
+ * @returns The formatted emoji.
206
+ */
207
+ export function formatEmoji < C extends Snowflake > ( emojiId : C , animated ?: true ) : `<a:_:${C } >`;
208
+
209
+ /**
210
+ * Formats an emoji ID into a fully qualified emoji identifier
211
+ * @param emojiId The emoji ID to format.
212
+ * @param animated Whether the emoji is animated or not. Defaults to `false`
213
+ * @returns The formatted emoji.
214
+ */
215
+ export function formatEmoji < C extends Snowflake > ( emojiId : C , animated = false ) : `<a:_:${C } >` | `<:_:${C } >` {
216
+ return `<${ animated ? 'a' : '' } :_:${ emojiId } >` ;
217
+ }
218
+
194
219
/**
195
220
* Formats a date into a short date-time string.
196
221
* @param date The date to format, defaults to the current time.
0 commit comments