Fixing formatting

This commit is contained in:
2024-01-21 00:03:19 +01:00
parent 614feeff3e
commit 9ec53882d1
15 changed files with 138 additions and 277 deletions

View File

@@ -35,9 +35,7 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
const button = client.buttons.get(interaction.customId)
if (!button) {
console.error(
`No event matching ${interaction.customId} was found.`
)
console.error(`No event matching ${interaction.customId} was found.`)
return
}
@@ -46,45 +44,33 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
} catch (error) {
if (process.env.NODE_ENV !== "dev") {
await logToChannel("error", {
embeds: [
{
title: "Button error occured",
description: "```" + error + "```",
color: embedColor,
footer: {
icon_url:
interaction.guild!.iconURL() || undefined,
text:
interaction.user.username +
" | " +
interaction.customId
}
embeds: [{
title: "Button error occured",
description: "```" + error + "```",
color: embedColor,
footer: {
icon_url: interaction.guild!.iconURL() || undefined,
text: interaction.user.username + " | " + interaction.customId
}
]
}]
})
}
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
}]
})
}
}