fix(discord): declare slash commands on module methods #96

Closed
Toutsu wants to merge 0 commits from codex/fix-issue-94-netcord-command-methods into main
Owner

Summary

  • Fixes issue #94 after manual Discord verification showed v3.0.2 still exposed only /ping.
  • Moves NetCord [SlashCommand] attributes from module classes to ExecuteAsync methods for /newsession, /listsessions, and /reschedule.
  • Adds tests proving NetCord discovers these commands via AddModules(assembly).
  • Bumps patch version to 3.0.3 across project, Docker tags, deploy workflow, and UI version label.

Root Cause

NetCord treats class-level [SlashCommand] on an ApplicationCommandModule<TContext> as a slash command group definition and returns before scanning method commands. Our session commands had the attributes on the class, so the module methods were not registered as standalone slash commands.

Test Plan

  • dotnet test tests\GmRelay.Bot.Tests\GmRelay.Bot.Tests.csproj --filter "FullyQualifiedName~DiscordStartupTests.DiscordSessionSlashCommands"
  • dotnet test tests\GmRelay.Bot.Tests\GmRelay.Bot.Tests.csproj --filter "FullyQualifiedName~DiscordStartupTests|FullyQualifiedName~DiscordProjectStructureTests"
  • dotnet build GM-Relay.slnx
  • dotnet test GM-Relay.slnx

Workflow

  • CI passes
  • Code review completed
  • Merged to main
  • Deployed
  • Release published
## Summary - Fixes issue #94 after manual Discord verification showed v3.0.2 still exposed only `/ping`. - Moves NetCord `[SlashCommand]` attributes from module classes to `ExecuteAsync` methods for `/newsession`, `/listsessions`, and `/reschedule`. - Adds tests proving NetCord discovers these commands via `AddModules(assembly)`. - Bumps patch version to `3.0.3` across project, Docker tags, deploy workflow, and UI version label. ## Root Cause NetCord treats class-level `[SlashCommand]` on an `ApplicationCommandModule<TContext>` as a slash command group definition and returns before scanning method commands. Our session commands had the attributes on the class, so the module methods were not registered as standalone slash commands. ## Test Plan - `dotnet test tests\GmRelay.Bot.Tests\GmRelay.Bot.Tests.csproj --filter "FullyQualifiedName~DiscordStartupTests.DiscordSessionSlashCommands"` - `dotnet test tests\GmRelay.Bot.Tests\GmRelay.Bot.Tests.csproj --filter "FullyQualifiedName~DiscordStartupTests|FullyQualifiedName~DiscordProjectStructureTests"` - `dotnet build GM-Relay.slnx` - `dotnet test GM-Relay.slnx` ## Workflow - [ ] CI passes - [ ] Code review completed - [ ] Merged to main - [ ] Deployed - [ ] Release published
Toutsu added 1 commit 2026-05-25 16:28:35 +03:00
fix(discord): declare slash commands on module methods
PR Checks / test-and-build (pull_request) Successful in 8m26s
0b45aee96d
Author
Owner

Merged manually into main because Gitea MCP merge returned HTTP 405 for this repository. Merge commit: 9375fa45b24a7a07e4416bbe329198fa6dd8da4e.

CI PR run #238: success
Deploy main run #239: success
Release: https://git.codeanddice.ru/Toutsu/GmRelayBot/releases/tag/v3.0.3

Merged manually into `main` because Gitea MCP merge returned HTTP 405 for this repository. Merge commit: `9375fa45b24a7a07e4416bbe329198fa6dd8da4e`. CI PR run #238: success Deploy main run #239: success Release: https://git.codeanddice.ru/Toutsu/GmRelayBot/releases/tag/v3.0.3
Toutsu closed this pull request 2026-05-25 16:48:17 +03:00
Some checks are pending
PR Checks / test-and-build (pull_request) Successful in 8m26s

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Toutsu/GmRelayBot#96