From e2d7993182881747db7964d0e2e50af2fa7ef8fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Serna?= Date: Wed, 20 Jul 2022 22:12:27 -0300 Subject: [PATCH] Update MessageReaction docs --- .../biscuit/structures/MessageReaction.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/packages/biscuit/structures/MessageReaction.ts b/packages/biscuit/structures/MessageReaction.ts index b52e6a0..d0c2807 100644 --- a/packages/biscuit/structures/MessageReaction.ts +++ b/packages/biscuit/structures/MessageReaction.ts @@ -3,6 +3,10 @@ import type { DiscordMemberWithUser, DiscordMessageReactionAdd, DiscordReaction import Emoji from './Emoji.ts'; import Member from './Member.ts'; +/** + * Represents when a new reaction was added to a message. + * @link https://discord.com/developers/docs/topics/gateway#message-reaction-add + * */ export interface MessageReactionAdd { userId: string; channelId: string; @@ -12,13 +16,39 @@ export interface MessageReactionAdd { emoji: Partial; } +/** + * Represents when a reaction was removed from a message. + * Equal to MessageReactionAdd but without 'member' property. + * @see {@link MessageReactionAdd} + * @link https://discord.com/developers/docs/topics/gateway#message-reaction-remove-message-reaction-remove-event-fields + */ export type MessageReactionRemove = Omit; + +/** + * Represents when all reactions were removed from a message. + * Equals to MessageReactionAdd but with 'channelId', 'messageId' and 'guildId' properties guaranteed. + * @see {@link MessageReactionAdd} + * @link https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all + */ export type MessageReactionRemoveAll = Pick + +/** + * Represents when a reaction-emoji was removed from a message. + * Equals to MessageReactionAdd but with 'channelId', 'messageId', 'emoji' and 'guildId' properties guaranteed. + * @see {@link MessageReactionRemove} + * @see {@link Emoji} + * @link https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji + */ export type MessageReactionRemoveEmoji = Pick< MessageReactionAdd, 'channelId' | 'guildId' | 'messageId' | 'emoji' >; +/** + * Creates a new MessageReactionAdd object. + * @param session - Current application session. + * @param data - Discord message reaction to parse. + */ export function NewMessageReactionAdd(session: Session, data: DiscordMessageReactionAdd): MessageReactionAdd { return { userId: data.user_id,