Log more more information on error (origin, type)

also fix the emoji in embed sent in reply
This commit is contained in:
Wroclaw 2023-03-22 06:40:16 +01:00
parent dffb13361c
commit 960c340760
2 changed files with 4 additions and 2 deletions

View file

@ -61,12 +61,13 @@ discord.on("messageCreate", async message => {
message.react("😶");
}
} catch (e) {
console.error(`Error ocurred while handling chat completion request (${(e as object).constructor.name}):`);
console.error(e);
message.reply({
embeds: [{
color: 0xff0000,
description: "Something bad happened! :frown:"
description: "Something bad happened! :frowning:"
}],
allowedMentions: {
repliedUser: false,

View file

@ -30,7 +30,8 @@ export default class Moderation {
return flagged;
}
catch (e) {
console.log(e);
console.error(`Error occured while handling moderation request (${(e as object).constructor.name}):`);
console.error(e);
return false;
}
}