Skip to content

feat(discord): GM commands, direct messages and scheduled events (M6) - #1162

Open
sven-n wants to merge 4 commits into
claude/sweet-cray-w8crms-m5from
claude/sweet-cray-w8crms-m6
Open

sven-n wants to merge 4 commits into
claude/sweet-cray-w8crms-m5from
claude/sweet-cray-w8crms-m6

Conversation

@sven-n

@sven-n sven-n commented Oct 9, 2026

Copy link
Copy Markdown
Member

Milestone M6 of the Discord integration (#1104). Stacked on #1161 (M5).

What

  • GM slash commands (M6.1):
    • Commands:
      • /announce <text> calls IGameServer.SendGlobalMessageAsync (golden notice) on all game servers.
      • /kick <character> calls DisconnectPlayerAsync and /ban <character> calls BanPlayerAsync. Each goes to the game servers until one succeeds; the Dapr clients broadcast.
    • Access: allowed only with the layout role GM on the hosted Discord and a linked account whose selected character has CharacterStatus.GameMaster. This uses the new light query IPlayerContext.GetCharacterStatusAsync.
    • Audit: every use is logged and posted into the new notification category StaffAlerts, routed to #staff-alerts by the layout.
  • Direct messages (M6.2): opt-in per type, stored as AccountNotificationTypes flags on AccountExternalLink, with a migration and compiled models. Toggled with /notify type enabled in Discord or /discord notify login|letter|friend in game. New game events are published directly by the game:
    • AccountLoginBlockedEvent: login with the correct password while the account is already logged in. The account is resolved with the new GetAccountIdByLoginNameAsync.
    • LetterReceivedEvent: published by LetterSendAction.
    • PlayerEnteredGameEvent: published by GameServerContext. Friends with the opt-in are notified unless the player is invisible, checked with IFriendServer.GetOnlineServerIdAsync.
    • Sending: DMs are sent in the background, so the game never waits for the database or Discord.
  • Discord Scheduled Events (M6.3):
    • CastleSiegeStateChangedEvent gets the optional NextBattleStartUtc / NextBattleEndUtc, from the new CastleSiegeSchedule.GetNextPeriod.
    • With Bot__CreateScheduledEvents=true the bot creates or updates an external scheduled event "Castle Siege" on the hosted Discord. It needs the Create Events permission.
  • Docs: sections for GM commands, direct messages and scheduled events, plus a new setting.
  • Fix in M5 (feat(discord): chat bridge for guild, alliance and world chat (M5) #1161): the M5 docs had lost the ## Settings heading. It's restored on M5 and merged forward.

Notes

  • Only castle siege becomes a scheduled event. Blood Castle and the like run every few hours and would flood the event list.
  • The new game events are published directly by the game, not through the optional Game Event Publisher plugin, because they are personal notifications that need the user's opt-in anyway.

Tests

  • DiscordGameMasterCommandsTest: role and GM checks, announcing to all servers, kick/ban routing, staff alert text.
  • DiscordDirectMessagesTest: opt-in, letter, blocked login, friend online and invisible friend.
  • CastleSiegeNextBattleTest: next battle this week and next week, unscheduled state.
  • /discord notify toggling, and serialization of the new events.
  • Full solution test run is green.

Not tested against a real Discord bot or a real PostgreSQL database.

🤖 Generated with Claude Code

https://claude.ai/code/session_01USFZ9xErMB1EwkpfdUHzoZ


Generated by Claude Code

claude added 4 commits October 9, 2026 08:34
…tle siege

The game publishes blocked logins, received letters and characters which
entered the game, and the castle siege events tell when the next battle
takes place. /discord notify turns direct messages in Discord on or off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01USFZ9xErMB1EwkpfdUHzoZ
…d events

/announce, /kick and /ban are allowed for users with the GM role and a linked
game master character, and every use is posted to the staff alerts channel.
Linked users opt in to direct messages with /notify. The bot can create a
scheduled event for the next castle siege.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01USFZ9xErMB1EwkpfdUHzoZ
…s and scheduled events

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01USFZ9xErMB1EwkpfdUHzoZ
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying openmudocs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0e66685
Status: ✅  Deploy successful!
Preview URL: https://f1126b33.openmudocs.pages.dev
Branch Preview URL: https://claude-sweet-cray-w8crms-m6.openmudocs.pages.dev

View logs

This branch has not been deployed

No deployments
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