Added error log channel
This commit is contained in:
@@ -9,5 +9,6 @@
|
|||||||
"onlineLogChannel": "1101144489306886226",
|
"onlineLogChannel": "1101144489306886226",
|
||||||
"botLogChannel": "1174403585149243472",
|
"botLogChannel": "1174403585149243472",
|
||||||
"guildLogChannel": "1183733282534326322",
|
"guildLogChannel": "1183733282534326322",
|
||||||
|
"errorLogChannel": "1191051275442339951",
|
||||||
"instructionsgif": "https://cdn.discordapp.com/attachments/838716950723952640/1188211176300089384/4DMu513uNxbM.gif?ex=6599b2e4&is=65873de4&hm=e727c7a39aacbc47d6a5453f4b5f792a45679983c30d662cd258a311381b6df0&"
|
"instructionsgif": "https://cdn.discordapp.com/attachments/838716950723952640/1188211176300089384/4DMu513uNxbM.gif?ex=6599b2e4&is=65873de4&hm=e727c7a39aacbc47d6a5453f4b5f792a45679983c30d662cd258a311381b6df0&"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import { ExtendedClient as Client } from "../Client"
|
import { ExtendedClient as Client } from "../Client"
|
||||||
|
import { errorLogChannel, color } from "../../../config/options.json"
|
||||||
import { Autocomplete } from "../../interfaces"
|
import { Autocomplete } from "../../interfaces"
|
||||||
import { Events } from "discord.js"
|
import { Events, GuildTextBasedChannel } from "discord.js"
|
||||||
import path = require("path")
|
import path = require("path")
|
||||||
import fs = require("fs")
|
import fs = require("fs")
|
||||||
import { FileType } from "../../typings"
|
import { FileType } from "../../typings"
|
||||||
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
||||||
const autocompletePath = path.join(
|
const autocompletePath = path.join(
|
||||||
@@ -49,6 +51,22 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
|||||||
try {
|
try {
|
||||||
await autocomplete.execute(interaction)
|
await autocomplete.execute(interaction)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
const channel = client.channels.cache.get(errorLogChannel) as GuildTextBasedChannel
|
||||||
|
if (!channel) {
|
||||||
|
console.log("No error log channel found.")
|
||||||
|
}
|
||||||
|
|
||||||
|
await channel.send({
|
||||||
|
embeds: [{
|
||||||
|
title: "Autocomplete error occured",
|
||||||
|
description: String(error),
|
||||||
|
color: embedColor,
|
||||||
|
footer: {
|
||||||
|
icon_url: interaction.guild!.iconURL({ forceStatic: false })!,
|
||||||
|
text: interaction.user.username + " | " + interaction.commandName
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
})
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import { ExtendedClient as Client } from "../Client"
|
import { ExtendedClient as Client } from "../Client"
|
||||||
|
import { errorLogChannel, color } from "../../../config/options.json"
|
||||||
import { Button } from "../../interfaces"
|
import { Button } from "../../interfaces"
|
||||||
import { Events } from "discord.js"
|
import { Events, GuildTextBasedChannel } from "discord.js"
|
||||||
import path = require("path")
|
import path = require("path")
|
||||||
import fs = require("fs")
|
import fs = require("fs")
|
||||||
import { FileType } from "../../typings"
|
import { FileType } from "../../typings"
|
||||||
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
export default function loadButtonEvents(client: Client, ft: FileType) {
|
export default function loadButtonEvents(client: Client, ft: FileType) {
|
||||||
const btnPath = path.join(__dirname, "..", "..", "events", "buttons")
|
const btnPath = path.join(__dirname, "..", "..", "events", "buttons")
|
||||||
@@ -37,6 +39,22 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
|
|||||||
try {
|
try {
|
||||||
await button.execute(interaction)
|
await button.execute(interaction)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
const channel = client.channels.cache.get(errorLogChannel) as GuildTextBasedChannel
|
||||||
|
if (!channel) {
|
||||||
|
console.log("No error log channel found.")
|
||||||
|
}
|
||||||
|
|
||||||
|
await channel.send({
|
||||||
|
embeds: [{
|
||||||
|
title: "Button error occured",
|
||||||
|
description: String(error),
|
||||||
|
color: embedColor,
|
||||||
|
footer: {
|
||||||
|
icon_url: interaction.guild!.iconURL({ forceStatic: false })!,
|
||||||
|
text: interaction.user.username + " | " + interaction.customId
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
})
|
||||||
console.error(error)
|
console.error(error)
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: "There was an error while executing this event!",
|
content: "There was an error while executing this event!",
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import { ExtendedClient as Client } from "../Client"
|
import { ExtendedClient as Client } from "../Client"
|
||||||
|
import { errorLogChannel, color } from "../../../config/options.json"
|
||||||
import { Command } from "../../interfaces"
|
import { Command } from "../../interfaces"
|
||||||
import { Events } from "discord.js"
|
import { Events, GuildTextBasedChannel } from "discord.js"
|
||||||
import path = require("path")
|
import path = require("path")
|
||||||
import fs = require("fs")
|
import fs = require("fs")
|
||||||
import { FileType } from "../../typings"
|
import { FileType } from "../../typings"
|
||||||
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
||||||
const cmdPath = path.join(__dirname, "..", "..", "commands")
|
const cmdPath = path.join(__dirname, "..", "..", "commands")
|
||||||
@@ -38,6 +40,23 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
|||||||
try {
|
try {
|
||||||
await command.execute(interaction, client)
|
await command.execute(interaction, client)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
const channel = client.channels.cache.get(errorLogChannel) as GuildTextBasedChannel
|
||||||
|
if (!channel) {
|
||||||
|
console.log("No error log channel found.")
|
||||||
|
}
|
||||||
|
|
||||||
|
await channel.send({
|
||||||
|
embeds: [{
|
||||||
|
title: "Command error occured",
|
||||||
|
description: String(error),
|
||||||
|
color: embedColor,
|
||||||
|
footer: {
|
||||||
|
icon_url: interaction.guild!.iconURL({ forceStatic: false })!,
|
||||||
|
text: interaction.user.username + " | " + interaction.commandName
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
})
|
||||||
|
|
||||||
console.error(error)
|
console.error(error)
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: "There was an error while executing this command!",
|
content: "There was an error while executing this command!",
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import { ExtendedClient as Client } from "../Client"
|
import { ExtendedClient as Client } from "../Client"
|
||||||
import { ContextMenu } from "../../interfaces"
|
import { ContextMenu } from "../../interfaces"
|
||||||
import { Events } from "discord.js"
|
import { errorLogChannel, color } from "../../../config/options.json"
|
||||||
|
import { Events, GuildTextBasedChannel } from "discord.js"
|
||||||
import path = require("path")
|
import path = require("path")
|
||||||
import fs = require("fs")
|
import fs = require("fs")
|
||||||
import { FileType } from "../../typings"
|
import { FileType } from "../../typings"
|
||||||
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||||
const contextMenuPath = path.join(
|
const contextMenuPath = path.join(
|
||||||
@@ -45,6 +47,22 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
|||||||
try {
|
try {
|
||||||
await command.execute(interaction)
|
await command.execute(interaction)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
const channel = client.channels.cache.get(errorLogChannel) as GuildTextBasedChannel
|
||||||
|
if (!channel) {
|
||||||
|
console.log("No error log channel found.")
|
||||||
|
}
|
||||||
|
|
||||||
|
await channel.send({
|
||||||
|
embeds: [{
|
||||||
|
title: "Contextmenu error occured",
|
||||||
|
description: String(error),
|
||||||
|
color: embedColor,
|
||||||
|
footer: {
|
||||||
|
icon_url: interaction.guild!.iconURL({ forceStatic: false })!,
|
||||||
|
text: interaction.user.username + " | " + interaction.commandName
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
})
|
||||||
console.error(error)
|
console.error(error)
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: "There was an error while executing this command!",
|
content: "There was an error while executing this command!",
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import { ExtendedClient as Client } from "../Client"
|
import { ExtendedClient as Client } from "../Client"
|
||||||
|
import { errorLogChannel, color } from "../../../config/options.json"
|
||||||
import { Modal } from "../../interfaces"
|
import { Modal } from "../../interfaces"
|
||||||
import { Events } from "discord.js"
|
import { Events, GuildTextBasedChannel } from "discord.js"
|
||||||
import path = require("path")
|
import path = require("path")
|
||||||
import fs = require("fs")
|
import fs = require("fs")
|
||||||
import { FileType } from "../../typings"
|
import { FileType } from "../../typings"
|
||||||
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
export default function loadModalEvents(client: Client, ft: FileType) {
|
export default function loadModalEvents(client: Client, ft: FileType) {
|
||||||
const modalPath = path.join(__dirname, "..", "..", "events", "modals")
|
const modalPath = path.join(__dirname, "..", "..", "events", "modals")
|
||||||
@@ -40,6 +42,22 @@ export default function loadModalEvents(client: Client, ft: FileType) {
|
|||||||
await modal.execute(interaction)
|
await modal.execute(interaction)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
const channel = client.channels.cache.get(errorLogChannel) as GuildTextBasedChannel
|
||||||
|
if (!channel) {
|
||||||
|
console.log("No error log channel found.")
|
||||||
|
}
|
||||||
|
|
||||||
|
await channel.send({
|
||||||
|
embeds: [{
|
||||||
|
title: "Button error occured",
|
||||||
|
description: String(error),
|
||||||
|
color: embedColor,
|
||||||
|
footer: {
|
||||||
|
icon_url: interaction.guild!.iconURL({ forceStatic: false })!,
|
||||||
|
text: interaction.user.username + " | " + interaction.customId
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
})
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: "There was an error while executing this modal!",
|
content: "There was an error while executing this modal!",
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user