This commit is contained in:
Christopher Cookman 2025-09-15 07:26:02 -06:00
parent 3f9554e33e
commit 3bb2aa65cd

View file

@ -133,6 +133,8 @@ const execute = async (message) => {
message.channel.send('Category updated!');
break;
case "delete": // Delete
const product = global.productUpdateData[message.author.id].id;
console.log(product);
if (message.content.toLowerCase() === 'cancel') {
cancel(message.author);
return;
@ -141,14 +143,13 @@ const execute = async (message) => {
message.channel.send('You must type `confirm` to delete the product, or `cancel` to exit.');
return;
}
console.log(global.productUpdateData[message.author.id])
// Proceed with deletion
message.channel.send('Deletion Confirmed. Starting deletion process...').then(async msg => {
let curMsg = msg.content;
// Delete fileAuth
curMsg = curMsg + '\nDeleting file authorizations...'
await msg.edit(curMsg);
await pool.query('DELETE FROM fileAuth WHERE product = ?', [global.productUpdateData[message.author.id].id]);
await pool.query('DELETE FROM fileAuth WHERE product = ?', [product]);
// Delete file
curMsg = curMsg + '\nDeleting product file...'
await msg.edit(curMsg);