From 4050ff12182d93f17dbb83979d80c1aba5391b16 Mon Sep 17 00:00:00 2001 From: rainydevzz Date: Thu, 20 Mar 2025 13:35:51 -0700 Subject: [PATCH] chore: format --- src/commands/uptime.ts | 24 ++++++++++++++---------- src/utils/uptime-loop.ts | 20 ++++++++++++-------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/commands/uptime.ts b/src/commands/uptime.ts index 251f9d0..de19eef 100644 --- a/src/commands/uptime.ts +++ b/src/commands/uptime.ts @@ -3,13 +3,17 @@ import { Discord, Slash } from "discordx"; @Discord() export class Uptime { - @Slash({name: "uptime-setup", description: "set up uptime cmd"}) - async uptime(inter: CommandInteraction) { - if(inter.user.id != Bun.env.OWNER) { - await inter.reply("you cannot run this command :p"); - return - } - const channel = inter.client.channels.cache.get(Bun.env.SCYTHE_CHANNEL) as TextChannel; - await channel.send(`bot is up, last ping: | if the ping was more than 1 minute ago, cosmic needs to check the bot lol :3`) - } -} \ No newline at end of file + @Slash({ name: "uptime-setup", description: "set up uptime cmd" }) + async uptime(inter: CommandInteraction) { + if (inter.user.id != Bun.env.OWNER) { + await inter.reply("you cannot run this command :p"); + return; + } + const channel = inter.client.channels.cache.get( + Bun.env.SCYTHE_CHANNEL, + ) as TextChannel; + await channel.send( + `bot is up, last ping: | if the ping was more than 1 minute ago, cosmic needs to check the bot lol :3`, + ); + } +} diff --git a/src/utils/uptime-loop.ts b/src/utils/uptime-loop.ts index 2cbf7f2..6fa5251 100644 --- a/src/utils/uptime-loop.ts +++ b/src/utils/uptime-loop.ts @@ -1,12 +1,16 @@ import type { Client } from "discordx"; -import { sleep } from "./underage" +import { sleep } from "./underage"; import type { TextChannel } from "discord.js"; export const uptimeLoop = async (client: Client) => { - while(true) { - await sleep(30 * 1000); - const channel = client.channels.cache.get(Bun.env.SCYTHE_CHANNEL) as TextChannel; - const msg = await channel.messages.fetch(Bun.env.UPTIME_MESSAGE); - await msg.edit(`bot is up, last ping: | if the ping was more than 1 minute ago, cosmic needs to check the bot lol :3`) - } -} \ No newline at end of file + while (true) { + await sleep(30 * 1000); + const channel = client.channels.cache.get( + Bun.env.SCYTHE_CHANNEL, + ) as TextChannel; + const msg = await channel.messages.fetch(Bun.env.UPTIME_MESSAGE); + await msg.edit( + `bot is up, last ping: | if the ping was more than 1 minute ago, cosmic needs to check the bot lol :3`, + ); + } +};