Fix role configuration database persistence issue
- Fix /config roles add/remove commands not saving to database - Prevent upsertGuildConfig from overwriting direct database role updates - Add early return for role management to skip general config update - Ensure role IDs are properly persisted when using /config roles commands - Add proper success feedback and logging for role configuration changes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -264,8 +264,18 @@ module.exports = {
|
|||||||
updateMessage = `Removed **${role.name}** from self-assignable roles`;
|
updateMessage = `Removed **${role.name}** from self-assignable roles`;
|
||||||
}
|
}
|
||||||
|
|
||||||
updated = true;
|
// Don't set updated = true here since we're calling database methods directly
|
||||||
break;
|
// Skip the upsertGuildConfig call at the end
|
||||||
|
const embed = new EmbedBuilder()
|
||||||
|
.setTitle('✅ Configuration Updated')
|
||||||
|
.setColor(0x00ff00)
|
||||||
|
.setDescription(updateMessage)
|
||||||
|
.setFooter({ text: 'Use /config show to see all settings' });
|
||||||
|
|
||||||
|
await interaction.reply({ embeds: [embed] });
|
||||||
|
|
||||||
|
console.log(`Role configuration updated for ${interaction.guild.name}: ${action} ${role.name}`);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update configuration in database
|
// Update configuration in database
|
||||||
|
|||||||
Reference in New Issue
Block a user