scythe/src/utils/bump.ts

21 lines
544 B
TypeScript

import type { Client } from "discordx";
import type { TextChannel } from "discord.js";
import { sleep } from "./underage";
export const bumpRemind = async (client: Client) => {
while (true) {
await sleep(5000);
const f = await Bun.file("bump.json").text();
const data = JSON.parse(f);
if (data["bump"]) {
if (Date.now() - data["bump"] >= 60 * 120 * 1000) {
const channel = client.channels.cache.get(
Bun.env.BOT_CHANNEL,
) as TextChannel;
await channel.send("it's time to bump again!");
return;
}
}
}
};