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

@@ -1,11 +0,0 @@
module.exports = {
name: "conolelog",
description: "console log",
type: "event",
event: "ready",
/** @param { import('discord.js').Client } client */
execute(client) {
console.log("Logged in as " + client.user.tag + "!")
}
}

View File

@@ -0,0 +1,15 @@
import { Event } from "../../../interfaces"
import { ExtendedClient as Client } from "../../../utils/Client"
const event: Event = {
name: "conolelog",
description: "console log",
type: "event",
event: "ready",
execute(client: Client) {
console.log("Logged in as " + client.user!.tag + "!")
}
}
export = event

View File

@@ -1,12 +1,15 @@
const { onlineLogChannel, color } = require("../../../../config/options.json")
import { onlineLogChannel, color } from "../../../../config/options.json"
import { Event } from "../../../interfaces"
import { ExtendedClient as Client } from "../../../utils/Client"
import { ChannelType } from "discord.js"
module.exports = {
const event: Event = {
name: "sendonlinemessage",
description: "send an online message",
type: "event",
event: "ready",
execute(client) {
execute(client: Client) {
if (process.env.NODE_ENV === "dev") return
const channel = client.channels.cache.get(onlineLogChannel)
@@ -17,6 +20,11 @@ module.exports = {
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!",
@@ -25,3 +33,5 @@ module.exports = {
})
}
}
export = event

View File

@@ -1,14 +1,14 @@
const statuses = require("../../../../config/statuses.json")
import statuses = require("../../../../config/statuses.json")
import { Event } from "../../../interfaces"
import { ExtendedClient as Client } from "../../../utils/Client"
module.exports = {
const event: Event = {
name: "status",
description: "Sets the status of the bot",
type: "event",
event: "ready",
/** @param { import('discord.js').Client } client */
execute(client) {
execute(client: Client) {
// Playing 0
// Streaming 1
@@ -17,18 +17,22 @@ module.exports = {
// Custom 4
// Competing 5
client.user.setActivity(
const user = client.user!
user.setActivity(
{ name: statuses[0].name, type: statuses[0].type }
)
let i = 1
setInterval(() =>
client.user.setActivity(
statuses[i, i++ % statuses.length]
user.setActivity(
statuses[i++ % statuses.length]
),
1000 * 60 * 10
)
client.user.setStatus("dnd")
user.setStatus("dnd")
}
}
export = event