Repository navigation
feat(badge): add user context commands for viewing and assigning badges - #403
Merged
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
🚀 Deploy this PRCode-only changes
Manifest changes (e.g. new services in
|
|
✅ PR deployed to dev! Image: |
There was a problem hiding this comment.
🟡 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)] |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.