From 3669d5e1120ed0a6e8d8cb8c48414d7841efd594 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:04:31 +0000 Subject: [PATCH] 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 --------- Co-authored-by: Vlad Frangu Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/core/src/api/channel.ts | 50 ++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/packages/core/src/api/channel.ts b/packages/core/src/api/channel.ts index a651c4ff4..3ed52c0c5 100644 --- a/packages/core/src/api/channel.ts +++ b/packages/core/src/api/channel.ts @@ -92,9 +92,17 @@ export class ChannelsAPI { * @see {@link https://discord.com/developers/docs/resources/message#get-reactions} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to get the reactions for - * @param emoji - The emoji to get the reactions for + * @param emoji - The emoji to get the reactions for. URL encoding happens internally * @param query - The query options for fetching the reactions * @param options - The options for fetching the message reactions + * @example + * ```ts + * // Unicode. + * await api.channels.getMessageReactions('1234567890', '1234567890', '👍'); + * + * // Custom emoji. + * await api.channels.getMessageReactions('1234567890', '1234567890', 'emoji_name:1234567890'); + * ``` */ public async getMessageReactions( channelId: Snowflake, @@ -115,8 +123,16 @@ export class ChannelsAPI { * @see {@link https://discord.com/developers/docs/resources/message#delete-own-reaction} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to delete the reaction for - * @param emoji - The emoji to delete the reaction for + * @param emoji - The emoji to delete the reaction for. URL encoding happens internally * @param options - The options for deleting the reaction + * @example + * ```ts + * // Unicode. + * await api.channels.deleteOwnMessageReaction('1234567890', '1234567890', '👍'); + * + * // Custom emoji. + * await api.channels.deleteOwnMessageReaction('1234567890', '1234567890', 'emoji_name:1234567890'); + * ``` */ public async deleteOwnMessageReaction( channelId: Snowflake, @@ -135,9 +151,17 @@ export class ChannelsAPI { * @see {@link https://discord.com/developers/docs/resources/message#delete-user-reaction} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to delete the reaction for - * @param emoji - The emoji to delete the reaction for + * @param emoji - The emoji to delete the reaction for. URL encoding happens internally * @param userId - The id of the user to delete the reaction for * @param options - The options for deleting the reaction + * @example + * ```ts + * // Unicode. + * await api.channels.deleteUserMessageReaction('1234567890', '1234567890', '👍', '1234567890'); + * + * // Custom emoji. + * await api.channels.deleteUserMessageReaction('1234567890', '1234567890', 'emoji_name:1234567890', '1234567890'); + * ``` */ public async deleteUserMessageReaction( channelId: Snowflake, @@ -173,8 +197,16 @@ export class ChannelsAPI { * @see {@link https://discord.com/developers/docs/resources/message#delete-all-reactions-for-emoji} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to delete the reactions for - * @param emoji - The emoji to delete the reactions for + * @param emoji - The emoji to delete the reactions for. URL encoding happens internally * @param options - The options for deleting the reactions + * @example + * ```ts + * // Unicode. + * await api.channels.deleteAllMessageReactionsForEmoji('1234567890', '1234567890', '👍'); + * + * // Custom emoji. + * await api.channels.deleteAllMessageReactionsForEmoji('1234567890', '1234567890', 'emoji_name:1234567890'); + * ``` */ public async deleteAllMessageReactionsForEmoji( channelId: Snowflake, @@ -191,8 +223,16 @@ export class ChannelsAPI { * @see {@link https://discord.com/developers/docs/resources/message#create-reaction} * @param channelId - The id of the channel the message is in * @param messageId - The id of the message to add the reaction to - * @param emoji - The emoji to add the reaction with + * @param emoji - The emoji to add the reaction with. URL encoding happens internally * @param options - The options for adding the reaction + * @example + * ```ts + * // Unicode. + * await api.channels.addMessageReaction('1234567890', '1234567890', '👍'); + * + * // Custom emoji. + * await api.channels.addMessageReaction('1234567890', '1234567890', 'emoji_name:1234567890'); + * ``` */ public async addMessageReaction( channelId: Snowflake,