legica -added reactions

This commit is contained in:
Fran Jurmanović
2022-03-11 19:24:35 +01:00
parent e1e48d1518
commit 5b47873574

View File

@@ -1,4 +1,4 @@
import { Client, MessageEmbed, TextChannel } from "discord.js"; import { Client, Message, MessageEmbed, TextChannel } from "discord.js";
import * as cron from "node-cron"; import * as cron from "node-cron";
import axios from "axios"; import axios from "axios";
import cheerio from "cheerio"; import cheerio from "cheerio";
@@ -8,7 +8,7 @@ class ClientController {
public register = (): void => { public register = (): void => {
this.client.on("ready", (): void => { this.client.on("ready", (): void => {
cron.schedule("0 12 * * *", this.sendMessage); cron.schedule("0 9 * * *", this.sendMessage);
}); });
}; };
@@ -19,7 +19,13 @@ class ClientController {
this.client.channels.cache.forEach((channel) => { this.client.channels.cache.forEach((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); (channel as TextChannel).send(embeddedMessage).then((_message: Message) => {
_message.react("1");
_message.react("2");
_message.react("3");
_message.react("4");
_message.react("5");
});
}); });
}; };
} }