From c634018be3ef707228e41d53c3873929b5ca1519 Mon Sep 17 00:00:00 2001 From: ITOH <72305210+itohatweb@users.noreply.github.com> Date: Mon, 12 Apr 2021 21:16:44 +0200 Subject: [PATCH] getReactions --- src/helpers/messages/get_reactions.ts | 3 ++- src/types/messages/message_get_reactions.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 src/types/messages/message_get_reactions.ts diff --git a/src/helpers/messages/get_reactions.ts b/src/helpers/messages/get_reactions.ts index 88071ed62..ad3f1ed5b 100644 --- a/src/helpers/messages/get_reactions.ts +++ b/src/helpers/messages/get_reactions.ts @@ -2,13 +2,14 @@ import { rest } from "../../rest/rest.ts"; import { DiscordUser } from "../../types/users/user.ts"; import { Collection } from "../../util/collection.ts"; import { endpoints } from "../../util/constants.ts"; +import {GetReactions} from "../../types/messages/message_get_reactions.ts"; /** Get a list of users that reacted with this emoji. */ export async function getReactions( channelId: string, messageId: string, reaction: string, - options?: DiscordGetReactions, + options?: GetReactions, ) { const users = (await rest.runMethod( "get", diff --git a/src/types/messages/message_get_reactions.ts b/src/types/messages/message_get_reactions.ts new file mode 100644 index 000000000..4c6f12262 --- /dev/null +++ b/src/types/messages/message_get_reactions.ts @@ -0,0 +1,11 @@ +export interface GetReactions { + /** Get users before this user Id */ + before?: string; + /** Get users after this user Id */ + after?: string; + /** Max number of users to return (1-100) */ + limit?: number; +} + +/** https://discord.com/developers/docs/resources/channel#get-reactions-query-string-params */ +export type DiscordGetReactions = GetReactions;