This commit is contained in:
Christopher Cookman 2023-09-06 18:45:00 -06:00
parent 937d085731
commit 7805fc6b58
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -854,11 +854,9 @@ dcClient.on('interactionCreate', async interaction => {
});
sendLog(`${colors.green("[INFO]")} ${interaction.user.displayName} (${interaction.user.id}) added themselves to paging group ${group}`)
// Close the connection
conn.end();
}).catch((error) => {
interaction.editReply(`Error adding you to the paging group: ${error}`);
sendLog(`${colors.red("[ERROR]")} ${error}`);
conn.end();
});
} else {
// They're already in the group, return an ephemeral message saying so
@ -866,12 +864,10 @@ dcClient.on('interactionCreate', async interaction => {
content: "You're already in that paging group!",
ephemeral: true
});
conn.end();
}
}).catch((error) => {
interaction.editReply(`Error adding you to the paging group: ${error}`);
sendLog(`${colors.red("[ERROR]")} ${error}`);
conn.end();
});
break;
case "remove":
@ -883,7 +879,6 @@ dcClient.on('interactionCreate', async interaction => {
content: "You're not in that paging group!",
ephemeral: true
});
conn.end();
} else {
// They're in the group, remove them
conn.query(`DELETE FROM paging_groups WHERE ext = ${ext} AND \`page_number\` = ${group}`).then((result) => {
@ -892,17 +887,14 @@ dcClient.on('interactionCreate', async interaction => {
ephemeral: true
});
sendLog(`${colors.green("[INFO]")} ${interaction.user.displayName} (${interaction.user.id}) removed themselves from paging group ${group}`)
conn.end();
}).catch((error) => {
interaction.editReply(`Error removing you from the paging group: ${error}`);
sendLog(`${colors.red("[ERROR]")} ${error}`);
conn.end();
});
}
}).catch((error) => {
interaction.editReply(`Error removing you from the paging group: ${error}`);
sendLog(`${colors.red("[ERROR]")} ${error}`);
conn.end();
});
break;
}
@ -914,7 +906,7 @@ dcClient.on('interactionCreate', async interaction => {
ephemeral: true
});
})
conn.end();
break;
default:
break;