mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
refactor(helpers): separate functions into files (#667)
* refactor(helpers): separate functions into files * idk * idk
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { RequestManager } from "../../rest/request_manager.ts";
|
||||
import { DiscordGetReactionsParams, UserPayload } from "../../types/mod.ts";
|
||||
import { Collection } from "../../util/collection.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
/** Get a list of users that reacted with this emoji. */
|
||||
export async function getReactions(
|
||||
channelID: string,
|
||||
messageID: string,
|
||||
reaction: string,
|
||||
options?: DiscordGetReactionsParams,
|
||||
) {
|
||||
const users = (await RequestManager.get(
|
||||
endpoints.CHANNEL_MESSAGE_REACTION(channelID, messageID, reaction),
|
||||
options,
|
||||
)) as UserPayload[];
|
||||
|
||||
return new Collection(users.map((user) => [user.id, user]));
|
||||
}
|
||||
Reference in New Issue
Block a user