legica -fixed reactions

This commit is contained in:
Fran Jurmanović
2022-03-13 11:40:26 +01:00
parent 5b47873574
commit c63351ad9e

View File

@@ -16,16 +16,14 @@ class ClientController {
const href = await getFirstHtml(); const href = await getFirstHtml();
const { img, title } = await getImgTitle(href); const { img, title } = await getImgTitle(href);
this.client.channels.cache.forEach((channel) => { this.client.channels.cache.forEach(async (channel) => {
if (channel.type !== "text") return null; if (channel.type !== "text") return null;
const embeddedMessage = new MessageEmbed().setTitle(title).setImage(img); const embeddedMessage = new MessageEmbed().setTitle(title).setImage(img);
(channel as TextChannel).send(embeddedMessage).then((_message: Message) => { const msg = await (channel as TextChannel).send(embeddedMessage);
_message.react("1"); const reactions = ["1️⃣", "2⃣", "3⃣", "4⃣", "5⃣", "6⃣", "7⃣", "8⃣", "9⃣", "🔟"];
_message.react("2"); for (const reaction of reactions) {
_message.react("3"); await msg.react(reaction);
_message.react("4"); }
_message.react("5");
});
}); });
}; };
} }