Usded color log in event handlers
This commit is contained in:
@@ -2,6 +2,7 @@ import { ExtendedClient as Client } from "../Client"
|
||||
import { color } from "../../../config/options.json"
|
||||
import { Autocomplete } from "../../interfaces"
|
||||
import { Events } from "discord.js"
|
||||
import colorLog from "../functions/colors"
|
||||
import path = require("path")
|
||||
import fs = require("fs")
|
||||
import logToChannel from "../functions/logtochannel"
|
||||
@@ -31,9 +32,10 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
||||
) {
|
||||
client.autocomplete.set(autocomplete.name, autocomplete)
|
||||
} else {
|
||||
console.log(
|
||||
console.log(colorLog(
|
||||
`[WARNING] The autocomplete at ${filePath} is missing a required "name", "execute" or "type" property.`,
|
||||
)
|
||||
"red"
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ExtendedClient as Client } from "../Client"
|
||||
import colorLog from "../functions/colors"
|
||||
import { color } from "../../../config/options.json"
|
||||
import { Button } from "../../interfaces"
|
||||
import { Events } from "discord.js"
|
||||
@@ -19,9 +20,10 @@ 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(
|
||||
console.log(colorLog(
|
||||
`[WARNING] The button at ${filePath} is missing a required "name", "execute" or "type" property.`,
|
||||
)
|
||||
"red"
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ExtendedClient as Client } from "../Client"
|
||||
import colorLog from "../functions/colors"
|
||||
import { color } from "../../../config/options.json"
|
||||
import { Command } from "../../interfaces"
|
||||
import { Events } from "discord.js"
|
||||
@@ -19,9 +20,10 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
||||
if ("data" in cmd && "execute" in cmd && cmd.type === "slash") {
|
||||
client.commands.set(cmd.data.name, cmd)
|
||||
} else {
|
||||
console.log(
|
||||
console.log(colorLog(
|
||||
`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`,
|
||||
)
|
||||
"red"
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ExtendedClient as Client } from "../Client"
|
||||
import colorLog from "../functions/colors"
|
||||
import { ContextMenu } from "../../interfaces"
|
||||
import { color } from "../../../config/options.json"
|
||||
import { Events } from "discord.js"
|
||||
@@ -26,9 +27,10 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||
if ("data" in cmd && "execute" in cmd && cmd.type === "contextmenu") {
|
||||
client.contextmenus.set(cmd.data.name, cmd)
|
||||
} else {
|
||||
console.log(
|
||||
console.log(colorLog(
|
||||
`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`,
|
||||
)
|
||||
"red"
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { ExtendedClient as Client } from "../Client"
|
||||
import colorLog from "../functions/colors"
|
||||
import { color } from "../../../config/options.json"
|
||||
import { Modal } from "../../interfaces"
|
||||
import { Events} from "discord.js"
|
||||
import { Events } from "discord.js"
|
||||
import path = require("path")
|
||||
import fs = require("fs")
|
||||
import logToChannel from "../functions/logtochannel"
|
||||
@@ -21,9 +22,10 @@ export default function loadModalEvents(client: Client, ft: FileType) {
|
||||
if ("name" in modal && "execute" in modal && modal.type === "modal") {
|
||||
client.modals.set(modal.name, modal)
|
||||
} else {
|
||||
console.log(
|
||||
console.log(colorLog(
|
||||
`[WARNING] The modal at ${filePath} is missing a required "name", "execute" or "type" property.`,
|
||||
)
|
||||
"red"
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user