forked from cosmic/scythe
28 lines
846 B
TypeScript
28 lines
846 B
TypeScript
import { Client, Discord, On, type ArgsOf } from "discordx";
|
|
import { underageCheck } from "../utils/underage";
|
|
import { bumpRemind } from "../utils/bump";
|
|
import {stat, mkdir} from "fs/promises";
|
|
import { uptimeLoop } from "../utils/uptime-loop";
|
|
|
|
@Discord()
|
|
export class Ready {
|
|
@On({ event: "ready" })
|
|
async readyEvent([_]: ArgsOf<"ready">, client: Client) {
|
|
console.log(`${client.user?.displayName} is online and ready to rock! :3c`);
|
|
await client.initApplicationCommands();
|
|
await client.guilds.fetch();
|
|
const members = client.guilds.cache.get(Bun.env.GUILD!)?.members;
|
|
if(!((await stat("data")).isDirectory())) {
|
|
await mkdir("data")
|
|
}
|
|
if (!(await Bun.file("bump.json").exists())) {
|
|
await Bun.write("bump.json", "{}");
|
|
}
|
|
if (members) {
|
|
underageCheck(members);
|
|
}
|
|
bumpRemind(client);
|
|
uptimeLoop(client);
|
|
}
|
|
}
|