fix(discord): register slash command modules #95

Closed
Toutsu wants to merge 0 commits from codex/fix-issue-94-discord-slash-modules into main
Owner

Summary

  • Fixes #94 by registering NetCord application command modules with host.AddModules(typeof(Program).Assembly) after the Discord worker host is built.
  • Adds regression coverage for module registration and README Discord environment guidance.
  • Bumps release version to 3.0.2 across build, compose, deploy, nav, and version tests.

Root cause

/ping worked because it was registered directly through host.AddSlashCommand(...). The session commands were declared as NetCord modules, but the host never scanned the assembly with AddModules(...), so /newsession, /listsessions, and /reschedule were not published to Discord as slash commands.

Test plan

  • dotnet test tests/GmRelay.Bot.Tests/GmRelay.Bot.Tests.csproj --filter "FullyQualifiedName~DiscordStartupTests.Program_ShouldRegisterNetCordGatewayApplicationCommandsAndComponents"
  • dotnet test tests/GmRelay.Bot.Tests/GmRelay.Bot.Tests.csproj --filter "FullyQualifiedName~DiscordProjectStructureTests.Readme_ShouldNotAskForUnusedDiscordBotClientId"
  • dotnet build GM-Relay.slnx
  • dotnet test GM-Relay.slnx
  • Gitea Actions run #236 / run number 187 succeeded

Workflow

  • CI passes
  • Merged to main via fallback local merge commit 80e346d
  • Deployed by Gitea Actions run #237
  • Release v3.0.2 published
## Summary - Fixes #94 by registering NetCord application command modules with `host.AddModules(typeof(Program).Assembly)` after the Discord worker host is built. - Adds regression coverage for module registration and README Discord environment guidance. - Bumps release version to `3.0.2` across build, compose, deploy, nav, and version tests. ## Root cause `/ping` worked because it was registered directly through `host.AddSlashCommand(...)`. The session commands were declared as NetCord modules, but the host never scanned the assembly with `AddModules(...)`, so `/newsession`, `/listsessions`, and `/reschedule` were not published to Discord as slash commands. ## Test plan - [x] `dotnet test tests/GmRelay.Bot.Tests/GmRelay.Bot.Tests.csproj --filter "FullyQualifiedName~DiscordStartupTests.Program_ShouldRegisterNetCordGatewayApplicationCommandsAndComponents"` - [x] `dotnet test tests/GmRelay.Bot.Tests/GmRelay.Bot.Tests.csproj --filter "FullyQualifiedName~DiscordProjectStructureTests.Readme_ShouldNotAskForUnusedDiscordBotClientId"` - [x] `dotnet build GM-Relay.slnx` - [x] `dotnet test GM-Relay.slnx` - [x] Gitea Actions run #236 / run number 187 succeeded ## Workflow - [x] CI passes - [x] Merged to `main` via fallback local merge commit `80e346d` - [x] Deployed by Gitea Actions run #237 - [x] Release [v3.0.2](https://git.codeanddice.ru/Toutsu/GmRelayBot/releases/tag/v3.0.2) published
Toutsu added 1 commit 2026-05-25 15:50:49 +03:00
fix(discord): register slash command modules
PR Checks / test-and-build (pull_request) Successful in 8m27s
eff0128d29
Register NetCord application command modules after the host is built so module-based commands are published alongside the minimal /ping command.

Update README Discord env guidance to avoid the unused DISCORD_BOT_CLIENT_ID variable.

Bump version to 3.0.2.
Toutsu closed this pull request 2026-05-25 16:16:45 +03:00
Some checks are pending
PR Checks / test-and-build (pull_request) Successful in 8m27s

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#95