forked from cosmic/scythe
chore: format
This commit is contained in:
parent
6b5ec7b0e7
commit
4050ff1218
|
|
@ -3,13 +3,17 @@ import { Discord, Slash } from "discordx";
|
||||||
|
|
||||||
@Discord()
|
@Discord()
|
||||||
export class Uptime {
|
export class Uptime {
|
||||||
@Slash({name: "uptime-setup", description: "set up uptime cmd"})
|
@Slash({ name: "uptime-setup", description: "set up uptime cmd" })
|
||||||
async uptime(inter: CommandInteraction) {
|
async uptime(inter: CommandInteraction) {
|
||||||
if(inter.user.id != Bun.env.OWNER) {
|
if (inter.user.id != Bun.env.OWNER) {
|
||||||
await inter.reply("you cannot run this command :p");
|
await inter.reply("you cannot run this command :p");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
const channel = inter.client.channels.cache.get(Bun.env.SCYTHE_CHANNEL) as TextChannel;
|
const channel = inter.client.channels.cache.get(
|
||||||
await channel.send(`bot is up, last ping: <t:${Date.now()}:f> | if the ping was more than 1 minute ago, cosmic needs to check the bot lol :3`)
|
Bun.env.SCYTHE_CHANNEL,
|
||||||
|
) as TextChannel;
|
||||||
|
await channel.send(
|
||||||
|
`bot is up, last ping: <t:${Date.now()}:f> | if the ping was more than 1 minute ago, cosmic needs to check the bot lol :3`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
import type { Client } from "discordx";
|
import type { Client } from "discordx";
|
||||||
import { sleep } from "./underage"
|
import { sleep } from "./underage";
|
||||||
import type { TextChannel } from "discord.js";
|
import type { TextChannel } from "discord.js";
|
||||||
|
|
||||||
export const uptimeLoop = async (client: Client) => {
|
export const uptimeLoop = async (client: Client) => {
|
||||||
while(true) {
|
while (true) {
|
||||||
await sleep(30 * 1000);
|
await sleep(30 * 1000);
|
||||||
const channel = client.channels.cache.get(Bun.env.SCYTHE_CHANNEL) as TextChannel;
|
const channel = client.channels.cache.get(
|
||||||
|
Bun.env.SCYTHE_CHANNEL,
|
||||||
|
) as TextChannel;
|
||||||
const msg = await channel.messages.fetch(Bun.env.UPTIME_MESSAGE);
|
const msg = await channel.messages.fetch(Bun.env.UPTIME_MESSAGE);
|
||||||
await msg.edit(`bot is up, last ping: <t:${Date.now()}:f> | if the ping was more than 1 minute ago, cosmic needs to check the bot lol :3`)
|
await msg.edit(
|
||||||
|
`bot is up, last ping: <t:${Date.now()}:f> | if the ping was more than 1 minute ago, cosmic needs to check the bot lol :3`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue