Skip to content

Commit

Permalink
feat: fetch exam information on startup
Browse files Browse the repository at this point in the history
This closes #20
  • Loading branch information
sondr3 committed Sep 16, 2020
1 parent 7f96807 commit 58e7a89
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { CommandoClient } from "discord.js-commando";
import { config } from "dotenv";
import path from "path";
import { writePage } from "./modules/exams";
import logger from "./utils/logger";

config();

Expand All @@ -24,6 +26,13 @@ client.once("ready", () => {
if (!client.user) throw new Error("User not authenticated");
console.log(`Logged in as ${client.user?.tag}! (${client.user?.id})`);
void client.user?.setActivity("STUDENTS", { type: "WATCHING" });

logger.info({ message: `Creating initial exam information` });
writePage().catch((err: Error) => {
logger.error({
message: err,
});
});
});

client.on("error", console.error);
Expand Down

0 comments on commit 58e7a89

Please sign in to comment.