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