Make the AI fix it ffs
This commit is contained in:
parent
67ccac5f1e
commit
0c52ab99e0
|
@ -35,7 +35,8 @@ const cancel = (user) => {
|
|||
}
|
||||
|
||||
const execute = async (message) => {
|
||||
switch (global.productUpdateData[message.author.id].type) {
|
||||
const userData = global.productUpdateData[message.author.id];
|
||||
switch (userData?.type) {
|
||||
case "name": // Name
|
||||
const newName = message.content.trim();
|
||||
if (newName.toLowerCase() === 'cancel') {
|
||||
|
@ -142,15 +143,15 @@ const execute = async (message) => {
|
|||
return;
|
||||
}
|
||||
// Proceed with deletion
|
||||
const pid = userData.id;
|
||||
message.channel.send('Deletion Confirmed. Starting deletion process...').then(async msg => {
|
||||
let pid = global.productUpdateData[message.author.id].id;
|
||||
let curMsg = msg.content;
|
||||
// Delete fileAuth
|
||||
curMsg = curMsg + '\nDeleting file authorizations...'
|
||||
curMsg = curMsg + '\nDeleting file authorizations...';
|
||||
await msg.edit(curMsg);
|
||||
await pool.query('DELETE FROM fileAuth WHERE product = ?', [pid]);
|
||||
// Delete file
|
||||
curMsg = curMsg + '\nDeleting product file...'
|
||||
curMsg = curMsg + '\nDeleting product file...';
|
||||
await msg.edit(curMsg);
|
||||
const [product] = await pool.query('SELECT file FROM products WHERE id = ?', [pid]);
|
||||
if (product) {
|
||||
|
@ -185,4 +186,4 @@ const execute = async (message) => {
|
|||
delete global.productUpdateData[message.author.id];
|
||||
delete global.dmHandlers[message.author.id];
|
||||
}
|
||||
module.exports = execute
|
||||
module.exports = execute
|
Loading…
Reference in a new issue