feat(discord): implement /newsession and /listsessions (issue #28) #85

Closed
Toutsu wants to merge 0 commits from feature/issue-28-discord-newsession-listsessions into main
Owner

Discord /newsession ? /listsessions ? Issue #28

??? ???????????

  • Slash-??????? /newsession ??? ???????? ??????? ?????? ????? ?? Discord.
  • Slash-??????? /listsessions ??? ????????? ??????????? ??? ? ???????.
  • DiscordPermissionChecker ? ???????? ???? (owner / admin / manager).
  • DiscordPlatformMessenger ? ?????????? IPlatformMessenger ??? Discord (NetCord REST).
  • ?????? ?????????? ? DI (Program.cs).

???????????

  • Vertical slice: ?????? ??????? ? ????????? ???? (Command + Handler).
  • Platform-agnostic SQL: ???????????? ??????? platform, external_group_id, external_user_id.
  • ????????? ?????????????? ???????????? DiscordSessionBatchRenderer.

TDD

  • 212 ??????, ??? ???????.
  • Source-level ????? ????????? ????????: Dapper, Npgsql, ??????????, CancellationToken, ????????????? ?????????????.

??????

  • Minor bump: 2.3.0 ? 2.4.0
  • ????????????????: Directory.Build.props, compose.yaml, deploy.yml, NavMenu.razor.

Closes #28

# Discord /newsession ? /listsessions ? Issue #28 ## ??? ??????????? - Slash-??????? /newsession ??? ???????? ??????? ?????? ????? ?? Discord. - Slash-??????? /listsessions ??? ????????? ??????????? ??? ? ???????. - DiscordPermissionChecker ? ???????? ???? (owner / admin / manager). - DiscordPlatformMessenger ? ?????????? IPlatformMessenger ??? Discord (NetCord REST). - ?????? ?????????? ? DI (Program.cs). ## ??????????? - Vertical slice: ?????? ??????? ? ????????? ???? (Command + Handler). - Platform-agnostic SQL: ???????????? ??????? platform, external_group_id, external_user_id. - ????????? ?????????????? ???????????? DiscordSessionBatchRenderer. ## TDD - 212 ??????, ??? ???????. - Source-level ????? ????????? ????????: Dapper, Npgsql, ??????????, CancellationToken, ????????????? ?????????????. ## ?????? - Minor bump: 2.3.0 ? 2.4.0 - ????????????????: Directory.Build.props, compose.yaml, deploy.yml, NavMenu.razor. Closes #28
Toutsu added 8 commits 2026-05-19 12:46:57 +03:00
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Task 5: DI wiring for DiscordNewSessionHandler, DiscordListSessionsHandler,
DiscordPermissionChecker, and DiscordPlatformMessenger.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Synchronized across Directory.Build.props, compose.yaml, deploy.yml,
NavMenu.razor, and project structure tests.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- DiscordPermissionChecker: removed dead-code userRoles overload;
  now only uses resolvedPermissions bitflag (Administrator = 0x8).
- DiscordNewSessionCommand: computes resolved permissions from guild
  user roles via Context.Guild.Users[Id].RoleIds + guild.Roles.
- DiscordNewSessionHandler: updated signature to accept ulong
  resolvedPermissions instead of unused userRoles.
- Added ILogger to command for diagnostics on unexpected errors.
- Added test: regular user with ManageServer (but not Admin) is rejected.

Refs issue #28

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
feat(discord): improve UX and add source-level tests for /newsession
PR Checks / test-and-build (pull_request) Successful in 5m59s
d55003a2a9
- DiscordNewSessionCommand: on success, renders session details via
  DiscordSessionBatchRenderer.Render() with embeds and action rows.
- DiscordNewSessionCommand: uses Discord emoji shortcodes for error
  and success messages (, , 💥).
- DiscordNewSessionHandlerTests: added 7 source-level structural tests
  verifying Dapper usage, NpgsqlDataSource, permission checks,
  platform neutrality, transaction safety, CancellationToken usage,
  and embed rendering in the command.

Refs issue #28

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Toutsu closed this pull request 2026-05-19 14:21:38 +03:00
Some checks are pending
PR Checks / test-and-build (pull_request) Successful in 5m59s

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