From 8536c4b968c5efc3cd9abd6a92ca6c716c6f64da Mon Sep 17 00:00:00 2001 From: Essem Date: Tue, 28 Jun 2022 08:16:57 -0500 Subject: [PATCH] Better error logging, update playing messages --- events/interactionCreate.js | 2 +- events/messageCreate.js | 2 +- messages.json | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/events/interactionCreate.js b/events/interactionCreate.js index 90323fc..b756fe0 100644 --- a/events/interactionCreate.js +++ b/events/interactionCreate.js @@ -94,7 +94,7 @@ export default async (client, cluster, worker, ipc, interaction) => { } else if (error.toString().includes("Timed out")) { await interaction[interaction.acknowledged ? "editOriginalMessage" : "createMessage"]("The request timed out before I could download that image. Try uploading your image somewhere else or reducing its size."); } else { - logger.error(`Error occurred with slash command ${command} with arguments ${JSON.stringify(interaction.data.options)}: ${JSON.stringify(error)}`); + logger.error(`Error occurred with slash command ${command} with arguments ${JSON.stringify(interaction.data.options)}: ${typeof error === "object" ? JSON.stringify(error) : error.toString()}`); try { await interaction[interaction.acknowledged ? "editOriginalMessage" : "createMessage"]("Uh oh! I ran into an error while running this command. Please report the content of the attached file at the following link or on the esmBot Support server: ", { file: `Message: ${await clean(error)}\n\nStack Trace: ${await clean(error.stack)}`, diff --git a/events/messageCreate.js b/events/messageCreate.js index b7f267d..3f69240 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -189,7 +189,7 @@ export default async (client, cluster, worker, ipc, message) => { content: "The request timed out before I could download that image. Try uploading your image somewhere else or reducing its size." }, reference)); } else { - _error(`Error occurred with command message ${message.cleanContent}: ${error.toString()}`); + _error(`Error occurred with command message ${message.cleanContent}: ${typeof error === "object" ? JSON.stringify(error) : error.toString()}`); try { await client.createMessage(message.channel.id, Object.assign({ content: "Uh oh! I ran into an error while running this command. Please report the content of the attached file at the following link or on the esmBot Support server: " diff --git a/messages.json b/messages.json index ac3db1f..f4eeab5 100644 --- a/messages.json +++ b/messages.json @@ -95,7 +95,7 @@ "with GIFs", "check out more stuff at projectlounge.pw", "the", - "sissy hypnosis", + "you just lost the game", "Yandere Simulator", "PogChamp", "yourself", @@ -153,6 +153,12 @@ "Minecraft Alpha 1.0.16.05", "dame da ne", "Fall Guys", + "with a box of wind", + "The Incredibles", + "AVIF", + "Sega Nomad", + "Item Asylum", + "TIC-80", "The clock is ticking." ] }