Skip to content

feat(badge): add user context commands for viewing and assigning badges - #403

Merged
Pierre-Demessence merged 1 commit into
masterfrom
feature/badge-menus
Sep 13, 2026
Merged

Pierre-Demessence merged 1 commit into
masterfrom
feature/badge-menus

Conversation

@Pierre-Demessence

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings September 13, 2026 17:42
@github-actions

Copy link
Copy Markdown

🚀 Deploy this PR

Code-only changes

  1. Make sure the udc-bot-dev ArgoCD app target revision is set to master.
  2. Go to the Deploy to Dev workflow and click Run workflow with this PR number.

Manifest changes (e.g. new services in k8s/dev/)

  1. Comment /build on this PR to build the Docker image (without deploying to master).
  2. Once the build succeeds, update the image tag in k8s/dev/bot.yaml on your branch with the SHA from the build comment, then push.
  3. In ArgoCD, switch the udc-bot-dev app target revision from master to your branch (App Details → Source → Edit → Save).
  4. ArgoCD will sync your manifest changes + new image. Test your changes.
  5. When done, switch ArgoCD target revision back to master.

@github-actions

Copy link
Copy Markdown

✅ PR deployed to dev!

Image: ghcr.io/unity-developer-community/udc-bot-dev:0436630
ArgoCD will sync shortly.

@github-actions
github-actions Bot temporarily deployed to dev September 13, 2026 17:44 Inactive

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new modal handler depends on guild member cache lookups and the success embed can exceed Discord’s field-length limits, both of which can cause user-facing failures.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds Discord user context-menu commands to the existing badge feature set, enabling quick per-user badge viewing and an admin-only modal flow for badge assignment.

Changes:

  • Add user context command View Badges that reuses the existing per-user badge embed output.
  • Add admin-only user context command Assign Badge that opens a modal and assigns a badge by ID or title.
  • Document the Badges feature as including these new context commands.
File summaries
File Description
docs/features.md Updates feature list entry for Badges to mention the new user context commands.
DiscordBot/Modules/BadgeSlashModule.cs Implements “View Badges” and “Assign Badge” user commands, a modal handler, and identifier resolution logic.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +223 to +229
var guildUser = Context.Guild?.GetUser(targetUserId);
if (guildUser == null)
{
await Context.Interaction.FollowupAsync("❌ User not found.", ephemeral: true);
return;
}

Comment on lines +261 to +266
var embed = new EmbedBuilder()
.WithTitle("🏆 Badge Assigned Successfully")
.WithDescription($"Assigned **{badge.Title}** to **{guildUser.DisplayName}**")
.AddField("Badge Description", badge.Description)
.AddField("Assigned By", Context.User.Mention)
.AddField("Assigned At", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss UTC"))
Comment on lines +211 to +212
[ModalInteraction("badge_assign_user:*", true)]
[RequireUserPermission(GuildPermission.Administrator)]
@Pierre-Demessence
Pierre-Demessence added this pull request to the merge queue Sep 13, 2026
Merged via the queue into master with commit aae9949 Sep 13, 2026
8 checks passed
@Pierre-Demessence
Pierre-Demessence deleted the feature/badge-menus branch September 13, 2026 17:50

This branch was previously deployed

1 inactive deployment
dev — 0436630c Deployed Sep 13, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants