From 663f1313e9b1557eff1a334f1a36cc9dabb2cfe2 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 4 Apr 2024 09:47:00 +0200 Subject: [PATCH] clean up: consistency --- commands/admin/member_roles/slash.js | 3 ++- commands/admin/self_roles/slash.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/admin/member_roles/slash.js b/commands/admin/member_roles/slash.js index 0f13507..5c83670 100644 --- a/commands/admin/member_roles/slash.js +++ b/commands/admin/member_roles/slash.js @@ -64,11 +64,12 @@ export async function execute(interaction) { }); // Toggle role assignment if found - if (found) { + if (found !== null) { found.assign = true; await found.save(); // Otherwise create new database entry } else await registerRole(interaction.guild, role); + // Reply successfully to acknowledge command await interaction.reply({ content: 'Successfully registered role.', diff --git a/commands/admin/self_roles/slash.js b/commands/admin/self_roles/slash.js index 2f9418a..fc35a5c 100644 --- a/commands/admin/self_roles/slash.js +++ b/commands/admin/self_roles/slash.js @@ -52,7 +52,7 @@ const registerSelfRoles = async (interaction) => { where: { id } }); - if (found) throw new Error('Messages already registered!'); + if (found !== null) throw new Error('Messages already registered!'); // Reply successfully to acknowledge command await interaction.reply({