legica
This commit is contained in:
@@ -7,17 +7,20 @@ class ClientController {
|
|||||||
constructor(private client: Client) {}
|
constructor(private client: Client) {}
|
||||||
|
|
||||||
public register = (): void => {
|
public register = (): void => {
|
||||||
|
this.sendMessage();
|
||||||
this.client.on("ready", (): void => {
|
this.client.on("ready", (): void => {
|
||||||
cron.schedule("0 12 * * *", async () => {
|
cron.schedule("0 12 * * *", this.sendMessage);
|
||||||
const href = await getFirstHtml();
|
});
|
||||||
const { img, title } = await getImgTitle(href);
|
};
|
||||||
|
|
||||||
this.client.channels.cache.forEach((channel) => {
|
private sendMessage = async (): Promise<void> => {
|
||||||
if (channel.type !== "text") return null;
|
const href = await getFirstHtml();
|
||||||
const embeddedMessage = new MessageEmbed().setTitle(title).setImage(img);
|
const { img, title } = await getImgTitle(href);
|
||||||
(channel as TextChannel).send(embeddedMessage);
|
|
||||||
});
|
this.client.channels.cache.forEach((channel) => {
|
||||||
});
|
if (channel.type !== "text") return null;
|
||||||
|
const embeddedMessage = new MessageEmbed().setTitle(title).setImage(img);
|
||||||
|
(channel as TextChannel).send(embeddedMessage);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user