generated from nhcarrigan/template
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import { Client, GatewayIntentBits, Events, Partials } from "discord.js";
|
||||
import { scheduleJob } from "node-schedule";
|
||||
import { handleMessageCreate } from "./events/handleMessageCreate.js";
|
||||
import { cacheData } from "./modules/cacheData.js";
|
||||
import {
|
||||
postFreeCodeCampNews,
|
||||
postHackerNews,
|
||||
@@ -35,10 +36,16 @@ const amari: Amari = {
|
||||
amari.discord.once(Events.ClientReady, () => {
|
||||
void logger.log("debug",
|
||||
`Authenticated to Discord as ${amari.discord.user?.username ?? "unknown"}`);
|
||||
void cacheData(amari);
|
||||
scheduleJob("post news", "0 * * * *", async() => {
|
||||
await logger.log("debug", "Fetching tech news.");
|
||||
await postFreeCodeCampNews(amari);
|
||||
await postHackerNews(amari);
|
||||
});
|
||||
scheduleJob("check guild tags", "0 0 * * *", async() => {
|
||||
await logger.log("debug", "Auditing guild tags.");
|
||||
await cacheData(amari);
|
||||
});
|
||||
});
|
||||
|
||||
amari.discord.on(Events.MessageCreate, (message) => {
|
||||
|
||||
Reference in New Issue
Block a user