swc/bundler/tests/.cache/deno/57c6d3494d2ad3de8a3b811b649bdad63a756eec.ts
강동윤 d60c3242af
fix(swc): Fix bugs (#1739)
swc_bundler:
 - Fix cycle detection for complex circular imports. (denoland/deno#10752)

swc_ecma_transforms_typescript:
 - Allow using large values for an enum variant.
2021-05-25 14:30:17 +09:00

18 lines
916 B
TypeScript

// Loaded from https://deno.land/x/discordeno@11.0.0-rc.2/src/helpers/messages/add_reactions.ts
import { eventHandlers } from "../../bot.ts";
import { addReaction } from "./add_reaction.ts";
/** Adds multiple reactions to a message. If `ordered` is true(default is false), it will add the reactions one at a time in the order provided. Note: Reaction takes the form of **name:id** for custom guild emoji, or Unicode characters. Requires READ_MESSAGE_HISTORY and ADD_REACTIONS */
export async function addReactions(channelId: bigint, messageId: bigint, reactions: string[], ordered = false) {
if (!ordered) {
await Promise.all(reactions.map((reaction) => addReaction(channelId, messageId, reaction)));
} else {
for (const reaction of reactions) {
eventHandlers.debug?.("loop", "Running for of loop in addReactions function.");
await addReaction(channelId, messageId, reaction);
}
}
}