Properly log Lavalink connection errors, fix large file fallback message, actions changes

This commit is contained in:
Essem 2022-10-02 13:28:43 -05:00
parent b9f1ccc39e
commit cfb5cb506f
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
4 changed files with 10 additions and 18 deletions

View file

@ -59,7 +59,7 @@ export default async (client, interaction) => {
} else if (error.toString().includes("Timed out")) {
await interaction[replyMethod]({ content: "The request timed out before I could download that image. Try uploading your image somewhere else or reducing its size.", flags: 64 });
} else {
logger.error(`Error occurred with application command ${command} with arguments ${JSON.stringify(interaction.data.options)}: ${error.stack || error}`);
logger.error(`Error occurred with application command ${command} with arguments ${JSON.stringify(interaction.data.optionsArray)}: ${error.stack || error}`);
try {
let err = error;
if (error?.constructor?.name == "Promise") err = await error;

View file

@ -140,7 +140,9 @@ export default async (client, message) => {
if (process.env.TEMPDIR && process.env.TEMPDIR !== "") {
await upload(client, result, message);
} else {
await client.rest.channels.createMessage(message.channelID, "The resulting image was more than 8MB in size, so I can't upload it.");
await client.rest.channels.createMessage(message.channelID, {
content: "The resulting image was more than 8MB in size, so I can't upload it."
});
}
} else {
await client.rest.channels.createMessage(message.channelID, Object.assign({