Some changes

This commit is contained in:
TriForMine
2021-10-18 20:34:58 +02:00
parent 36c95f41df
commit b68a5eca6f
2 changed files with 4 additions and 5 deletions

View File

@@ -1,5 +1,4 @@
import type { Bot } 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(
@@ -10,11 +9,11 @@ export async function addReactions(
ordered = false
) {
if (!ordered) {
await Promise.all(reactions.map((reaction) => addReaction(bot, channelId, messageId, reaction)));
await Promise.all(reactions.map((reaction) => bot.helpers.addReaction(bot, channelId, messageId, reaction)));
} else {
for (const reaction of reactions) {
bot.events.debug?.("loop", "Running for of loop in addReactions function.");
await addReaction(bot, channelId, messageId, reaction);
bot.events.debug("loop", "Running for of loop in addReactions function.");
await bot.helpers.addReaction(bot, channelId, messageId, reaction);
}
}
}

View File

@@ -13,7 +13,7 @@ export async function suppressEmbeds(bot: Bot, channelId: bigint, messageId: big
bot.rest,
"patch",
bot.constants.endpoints.CHANNEL_MESSAGE(channelId, messageId),
bot.utils.snakelize({ flags: 4 })
{ flags: 4 }
);
return await bot.transformers.message(bot, result);