clean up: consistency

This commit is contained in:
Baipyrus 2024-04-04 09:47:00 +02:00
parent 9091e1c023
commit 663f1313e9
2 changed files with 3 additions and 2 deletions

View File

@ -64,11 +64,12 @@ export async function execute(interaction) {
}); });
// Toggle role assignment if found // Toggle role assignment if found
if (found) { if (found !== null) {
found.assign = true; found.assign = true;
await found.save(); await found.save();
// Otherwise create new database entry // Otherwise create new database entry
} else await registerRole(interaction.guild, role); } else await registerRole(interaction.guild, role);
// Reply successfully to acknowledge command // Reply successfully to acknowledge command
await interaction.reply({ await interaction.reply({
content: 'Successfully registered role.', content: 'Successfully registered role.',

View File

@ -52,7 +52,7 @@ const registerSelfRoles = async (interaction) => {
where: { id } where: { id }
}); });
if (found) throw new Error('Messages already registered!'); if (found !== null) throw new Error('Messages already registered!');
// Reply successfully to acknowledge command // Reply successfully to acknowledge command
await interaction.reply({ await interaction.reply({