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({