From 46cbb19eac4a75da7d143848be22042f66eb277a Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 8 Nov 2025 13:41:16 +0000 Subject: [PATCH] Add role assignment in set-realm after realm selection cgen-d08b34fcabe44d5f894e2dc491319742 --- discord-bot/commands/set-realm.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/discord-bot/commands/set-realm.js b/discord-bot/commands/set-realm.js index 7d9c0c70..c1af120a 100644 --- a/discord-bot/commands/set-realm.js +++ b/discord-bot/commands/set-realm.js @@ -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: [] });