Skip to content

Commit 3669d5e

Browse files
Jiralitevladfrangukodiakhq[bot]
authored
docs(channel): Clarify emoji parameter (#10595)
* docs(channel): clarify emoji parameter * docs: actually add `@example` * docs: clarify the kind of encoding Co-Authored-By: Vlad Frangu <[email protected]> --------- Co-authored-by: Vlad Frangu <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 6775175 commit 3669d5e

File tree

1 file changed

+45
-5
lines changed

1 file changed

+45
-5
lines changed

packages/core/src/api/channel.ts

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,17 @@ export class ChannelsAPI {
9292
* @see {@link https://discord.com/developers/docs/resources/message#get-reactions}
9393
* @param channelId - The id of the channel the message is in
9494
* @param messageId - The id of the message to get the reactions for
95-
* @param emoji - The emoji to get the reactions for
95+
* @param emoji - The emoji to get the reactions for. URL encoding happens internally
9696
* @param query - The query options for fetching the reactions
9797
* @param options - The options for fetching the message reactions
98+
* @example
99+
* ```ts
100+
* // Unicode.
101+
* await api.channels.getMessageReactions('1234567890', '1234567890', '👍');
102+
*
103+
* // Custom emoji.
104+
* await api.channels.getMessageReactions('1234567890', '1234567890', 'emoji_name:1234567890');
105+
* ```
98106
*/
99107
public async getMessageReactions(
100108
channelId: Snowflake,
@@ -115,8 +123,16 @@ export class ChannelsAPI {
115123
* @see {@link https://discord.com/developers/docs/resources/message#delete-own-reaction}
116124
* @param channelId - The id of the channel the message is in
117125
* @param messageId - The id of the message to delete the reaction for
118-
* @param emoji - The emoji to delete the reaction for
126+
* @param emoji - The emoji to delete the reaction for. URL encoding happens internally
119127
* @param options - The options for deleting the reaction
128+
* @example
129+
* ```ts
130+
* // Unicode.
131+
* await api.channels.deleteOwnMessageReaction('1234567890', '1234567890', '👍');
132+
*
133+
* // Custom emoji.
134+
* await api.channels.deleteOwnMessageReaction('1234567890', '1234567890', 'emoji_name:1234567890');
135+
* ```
120136
*/
121137
public async deleteOwnMessageReaction(
122138
channelId: Snowflake,
@@ -135,9 +151,17 @@ export class ChannelsAPI {
135151
* @see {@link https://discord.com/developers/docs/resources/message#delete-user-reaction}
136152
* @param channelId - The id of the channel the message is in
137153
* @param messageId - The id of the message to delete the reaction for
138-
* @param emoji - The emoji to delete the reaction for
154+
* @param emoji - The emoji to delete the reaction for. URL encoding happens internally
139155
* @param userId - The id of the user to delete the reaction for
140156
* @param options - The options for deleting the reaction
157+
* @example
158+
* ```ts
159+
* // Unicode.
160+
* await api.channels.deleteUserMessageReaction('1234567890', '1234567890', '👍', '1234567890');
161+
*
162+
* // Custom emoji.
163+
* await api.channels.deleteUserMessageReaction('1234567890', '1234567890', 'emoji_name:1234567890', '1234567890');
164+
* ```
141165
*/
142166
public async deleteUserMessageReaction(
143167
channelId: Snowflake,
@@ -173,8 +197,16 @@ export class ChannelsAPI {
173197
* @see {@link https://discord.com/developers/docs/resources/message#delete-all-reactions-for-emoji}
174198
* @param channelId - The id of the channel the message is in
175199
* @param messageId - The id of the message to delete the reactions for
176-
* @param emoji - The emoji to delete the reactions for
200+
* @param emoji - The emoji to delete the reactions for. URL encoding happens internally
177201
* @param options - The options for deleting the reactions
202+
* @example
203+
* ```ts
204+
* // Unicode.
205+
* await api.channels.deleteAllMessageReactionsForEmoji('1234567890', '1234567890', '👍');
206+
*
207+
* // Custom emoji.
208+
* await api.channels.deleteAllMessageReactionsForEmoji('1234567890', '1234567890', 'emoji_name:1234567890');
209+
* ```
178210
*/
179211
public async deleteAllMessageReactionsForEmoji(
180212
channelId: Snowflake,
@@ -191,8 +223,16 @@ export class ChannelsAPI {
191223
* @see {@link https://discord.com/developers/docs/resources/message#create-reaction}
192224
* @param channelId - The id of the channel the message is in
193225
* @param messageId - The id of the message to add the reaction to
194-
* @param emoji - The emoji to add the reaction with
226+
* @param emoji - The emoji to add the reaction with. URL encoding happens internally
195227
* @param options - The options for adding the reaction
228+
* @example
229+
* ```ts
230+
* // Unicode.
231+
* await api.channels.addMessageReaction('1234567890', '1234567890', '👍');
232+
*
233+
* // Custom emoji.
234+
* await api.channels.addMessageReaction('1234567890', '1234567890', 'emoji_name:1234567890');
235+
* ```
196236
*/
197237
public async addMessageReaction(
198238
channelId: Snowflake,

0 commit comments

Comments
 (0)