diff --git a/messageHandlers/create_prod.js b/messageHandlers/create_prod.js index f37d037..aaa1fe5 100644 --- a/messageHandlers/create_prod.js +++ b/messageHandlers/create_prod.js @@ -100,6 +100,9 @@ const execute = async (message) => { } const file = fs.createWriteStream(`./productFiles/${crypto.randomBytes(8).toString('hex')}`); const prodId = crypto.randomUUID(); + if (!fs.existsSync('./productFiles')) { + fs.mkdirSync('./productFiles'); + } download(attachment.url, file.path, (err) => { if (err) { message.channel.send('Failed to download the file.');