diff --git a/events/messageCreate.js b/events/messageCreate.js index cc2a416..ae77e46 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -125,7 +125,7 @@ export default async (client, cluster, worker, ipc, message) => { } } if (result.file.length > fileSize) { - if (process.env.TEMPDIR !== "") { + if (process.env.TEMPDIR && process.env.TEMPDIR !== "") { const filename = `${Math.random().toString(36).substring(2, 15)}.${result.name.split(".")[1]}`; await promises.writeFile(`${process.env.TEMPDIR}/${filename}`, result.file); const imageURL = `${process.env.TMP_DOMAIN || "https://tmp.projectlounge.pw"}/${filename}`; @@ -142,6 +142,8 @@ export default async (client, cluster, worker, ipc, message) => { }, }] }, reference)); + } else { + await client.createMessage(message.channel.id, "The resulting image was more than 8MB in size, so I can't upload it."); } } else { await client.createMessage(message.channel.id, Object.assign({ diff --git a/shard.js b/shard.js index 6ebf170..6ed9514 100644 --- a/shard.js +++ b/shard.js @@ -47,7 +47,7 @@ class Shard extends BaseClusterWorker { await database.setup(this.ipc); // register events - log("info", `Attempting to load events...`); + log("info", "Attempting to load events..."); for await (const file of this.getFiles("./events/")) { log("log", `Loading event from ${file}...`); const eventArray = file.split("/");