Test
This commit is contained in:
parent
937d085731
commit
7805fc6b58
10
index.js
10
index.js
|
@ -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}`)
|
sendLog(`${colors.green("[INFO]")} ${interaction.user.displayName} (${interaction.user.id}) added themselves to paging group ${group}`)
|
||||||
// Close the connection
|
// Close the connection
|
||||||
conn.end();
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
interaction.editReply(`Error adding you to the paging group: ${error}`);
|
interaction.editReply(`Error adding you to the paging group: ${error}`);
|
||||||
sendLog(`${colors.red("[ERROR]")} ${error}`);
|
sendLog(`${colors.red("[ERROR]")} ${error}`);
|
||||||
conn.end();
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// They're already in the group, return an ephemeral message saying so
|
// 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!",
|
content: "You're already in that paging group!",
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
conn.end();
|
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
interaction.editReply(`Error adding you to the paging group: ${error}`);
|
interaction.editReply(`Error adding you to the paging group: ${error}`);
|
||||||
sendLog(`${colors.red("[ERROR]")} ${error}`);
|
sendLog(`${colors.red("[ERROR]")} ${error}`);
|
||||||
conn.end();
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "remove":
|
case "remove":
|
||||||
|
@ -883,7 +879,6 @@ dcClient.on('interactionCreate', async interaction => {
|
||||||
content: "You're not in that paging group!",
|
content: "You're not in that paging group!",
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
conn.end();
|
|
||||||
} else {
|
} else {
|
||||||
// They're in the group, remove them
|
// They're in the group, remove them
|
||||||
conn.query(`DELETE FROM paging_groups WHERE ext = ${ext} AND \`page_number\` = ${group}`).then((result) => {
|
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
|
ephemeral: true
|
||||||
});
|
});
|
||||||
sendLog(`${colors.green("[INFO]")} ${interaction.user.displayName} (${interaction.user.id}) removed themselves from paging group ${group}`)
|
sendLog(`${colors.green("[INFO]")} ${interaction.user.displayName} (${interaction.user.id}) removed themselves from paging group ${group}`)
|
||||||
conn.end();
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
interaction.editReply(`Error removing you from the paging group: ${error}`);
|
interaction.editReply(`Error removing you from the paging group: ${error}`);
|
||||||
sendLog(`${colors.red("[ERROR]")} ${error}`);
|
sendLog(`${colors.red("[ERROR]")} ${error}`);
|
||||||
conn.end();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
interaction.editReply(`Error removing you from the paging group: ${error}`);
|
interaction.editReply(`Error removing you from the paging group: ${error}`);
|
||||||
sendLog(`${colors.red("[ERROR]")} ${error}`);
|
sendLog(`${colors.red("[ERROR]")} ${error}`);
|
||||||
conn.end();
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -914,7 +906,7 @@ dcClient.on('interactionCreate', async interaction => {
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
conn.end();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue