Converted main codebase to typescript

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2023-12-28 13:17:57 +01:00
parent 1d9ded82a4
commit 68fde04bbb
122 changed files with 14230 additions and 1834 deletions

View File

@@ -0,0 +1,37 @@
import { onlineLogChannel, color } from "../../../../config/options.json"
import { Event } from "../../../interfaces"
import { ExtendedClient as Client } from "../../../utils/Client"
import { ChannelType } from "discord.js"
const event: Event = {
name: "sendonlinemessage",
description: "send an online message",
type: "event",
event: "ready",
execute(client: Client) {
if (process.env.NODE_ENV === "dev") return
const channel = client.channels.cache.get(onlineLogChannel)
const embedColor = Number(color.replace("#", "0x"))
if (!channel) {
console.log("[ERROR] Could not find channel used for online message.")
return
}
if (channel.type !== ChannelType.GuildText) {
console.log("[ERROR] Online message channel is not a text channel.")
return
}
channel.send({
embeds: [{
description: "Bot is online!",
color: embedColor
}]
})
}
}
export = event