Add role assignment in set-realm after realm selection

cgen-d08b34fcabe44d5f894e2dc491319742
This commit is contained in:
Builder.io 2025-11-08 13:41:16 +00:00
parent 7e6549c722
commit 46cbb19eac

View file

@ -96,11 +96,23 @@ module.exports = {
const realm = REALMS.find((r) => r.value === selectedRealm);
// Assign Discord role based on selected realm
const roleAssigned = await assignRoleByArm(
interaction.guild,
interaction.user.id,
selectedRealm,
supabase,
);
const roleStatus = roleAssigned
? "✅ Discord role assigned!"
: "⚠️ No role mapping found for this realm in this server.";
const confirmEmbed = new EmbedBuilder()
.setColor(0x00ff00)
.setTitle("✅ Realm Set")
.setDescription(
`Your primary realm is now **${realm.label}**\n\nYou'll be assigned the corresponding Discord role.`,
`Your primary realm is now **${realm.label}**\n\n${roleStatus}`,
);
await i.update({ embeds: [confirmEmbed], components: [] });