joel joel joel

This commit is contained in:
2024-05-02 13:22:15 +02:00
commit 73200479bd
20 changed files with 684 additions and 0 deletions

34
utils.ts Normal file
View File

@@ -0,0 +1,34 @@
import { ActivityType } from "discord.js";
import type { DiscordClient } from "./client";
let timer: Timer;
export const startTimer = (client: DiscordClient, interval: number) => {
timer = setInterval(async () => {
const awake = await client.ai.health();
if (!awake) {
client.user?.setActivity({
name: "Joel VAKNAR ge honom en minut",
type: ActivityType.Custom,
});
} else {
clearInterval(timer);
client.user?.setActivity({
name: "Joel är FUCKING VAKEN",
type: ActivityType.Custom,
});
console.log("joel has risen");
}
}, interval);
};
let sleepTimer: Timer;
export const setSleepTimer = (client: DiscordClient) => {
clearTimeout(sleepTimer);
sleepTimer = setTimeout(() => {
client.user?.setActivity({
type: ActivityType.Custom,
name: "Joel SOVER fucking VÄCK HONOM",
});
}, 15 * 60 * 1000);
};