generated from Baipyrus/DiscordJS-Template
clean up: consistency
This commit is contained in:
parent
9091e1c023
commit
663f1313e9
@ -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.',
|
||||||
|
@ -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({
|
||||||
|
Loading…
Reference in New Issue
Block a user