refactor(helpers): separate functions into files (#667)

* refactor(helpers): separate functions into files

* idk

* idk
This commit is contained in:
ayntee
2021-03-13 08:10:31 -05:00
committed by GitHub
parent 88ce4da555
commit e9cbbbff7c
143 changed files with 3362 additions and 2915 deletions
+19
View File
@@ -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]));
}