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) => {
|
const execute = async (message) => {
|
||||||
switch (global.productUpdateData[message.author.id].type) {
|
const userData = global.productUpdateData[message.author.id];
|
||||||
|
switch (userData?.type) {
|
||||||
case "name": // Name
|
case "name": // Name
|
||||||
const newName = message.content.trim();
|
const newName = message.content.trim();
|
||||||
if (newName.toLowerCase() === 'cancel') {
|
if (newName.toLowerCase() === 'cancel') {
|
||||||
|
@ -142,15 +143,15 @@ const execute = async (message) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Proceed with deletion
|
// Proceed with deletion
|
||||||
|
const pid = userData.id;
|
||||||
message.channel.send('Deletion Confirmed. Starting deletion process...').then(async msg => {
|
message.channel.send('Deletion Confirmed. Starting deletion process...').then(async msg => {
|
||||||
let pid = global.productUpdateData[message.author.id].id;
|
|
||||||
let curMsg = msg.content;
|
let curMsg = msg.content;
|
||||||
// Delete fileAuth
|
// Delete fileAuth
|
||||||
curMsg = curMsg + '\nDeleting file authorizations...'
|
curMsg = curMsg + '\nDeleting file authorizations...';
|
||||||
await msg.edit(curMsg);
|
await msg.edit(curMsg);
|
||||||
await pool.query('DELETE FROM fileAuth WHERE product = ?', [pid]);
|
await pool.query('DELETE FROM fileAuth WHERE product = ?', [pid]);
|
||||||
// Delete file
|
// Delete file
|
||||||
curMsg = curMsg + '\nDeleting product file...'
|
curMsg = curMsg + '\nDeleting product file...';
|
||||||
await msg.edit(curMsg);
|
await msg.edit(curMsg);
|
||||||
const [product] = await pool.query('SELECT file FROM products WHERE id = ?', [pid]);
|
const [product] = await pool.query('SELECT file FROM products WHERE id = ?', [pid]);
|
||||||
if (product) {
|
if (product) {
|
||||||
|
|
Loading…
Reference in a new issue