Updated imports and formating

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2024-01-16 17:05:15 +01:00
parent ee0250ed5e
commit 5661bc66bb
49 changed files with 819 additions and 491 deletions

View File

@@ -3,8 +3,8 @@ import colorLog from "utils/functions/colors"
import { color } from "config/options.json"
import { Button } from "interfaces"
import { Events } from "discord.js"
import path = require("path")
import fs = require("fs")
import path from "path"
import fs from "fs"
import logToChannel from "utils/functions/logtochannel"
type FileType = "js" | "ts"
const embedColor = Number(color.replace("#", "0x"))
@@ -20,10 +20,12 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
if ("name" in btn && "execute" in btn && btn.type === "button") {
client.buttons.set(btn.name, btn)
} else {
console.log(colorLog(
`[WARNING] The button at ${filePath} is missing a required "name", "execute" or "type" property.`,
"red"
))
console.log(
colorLog(
`[WARNING] The button at ${filePath} is missing a required "name", "execute" or "type" property.`,
"red",
),
)
}
}
@@ -50,7 +52,8 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
description: "```" + error + "```",
color: embedColor,
footer: {
icon_url: interaction.guild!.iconURL() || undefined,
icon_url:
interaction.guild!.iconURL() || undefined,
text:
interaction.user.username +
" | " +
@@ -64,18 +67,24 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
console.error(error)
if (!interaction.deferred) {
await interaction.reply({
embeds: [{
description: "There was an error while executing this button!",
color: embedColor,
}],
embeds: [
{
description:
"There was an error while executing this button!",
color: embedColor,
},
],
ephemeral: true,
})
} else {
await interaction.editReply({
embeds: [{
description: "There was an error while executing this button! 2",
color: embedColor,
}]
embeds: [
{
description:
"There was an error while executing this button! 2",
color: embedColor,
},
],
})
}
}