Skip to content

feat(discord_bot): hybrid sync command + automatic startup guild sync - #188

Merged
extreme4all merged 4 commits into
developfrom
feature/hybrid-sync-command
Aug 29, 2026
Merged

feat(discord_bot): hybrid sync command + automatic startup guild sync#188
extreme4all merged 4 commits into
developfrom
feature/hybrid-sync-command

Conversation

@extreme4all

Copy link
Copy Markdown
Contributor

Summary

  • make the sync command a hybrid command (!sync and /sync), owner + guild only
  • log sync callers (author, author_id, guild, spec, target guilds) and results as structured logs, matching the cogs' logging style
  • log failed per-guild syncs instead of silently swallowing discord.HTTPException
  • sync the command tree to SYNC_GUILD_ID in setup_hook on startup (instant, guild-scoped) so deploys no longer rely on manual !sync
  • new optional setting SYNC_GUILD_ID; when unset, startup sync is skipped with a warning

Commits

  1. refactor(discord_bot): make sync command a hybrid command
  2. feat(discord_bot): log sync command callers and results
  3. fix(discord_bot): log failed guild syncs instead of swallowing http errors
  4. feat(discord_bot): sync command tree to sync_guild on startup

Verification

  • Greedy[discord.Object] + Literal spec register correctly as a hybrid app command on discord.py 2.2.2 (smoke-tested HybridAppCommand construction)
  • sync_command_tree smoke-tested: skip path warns when SYNC_GUILD_ID unset; guild path copies global commands and syncs to the guild
  • ruff check + ruff format --check pass
  • 44 discord bot tests pass

Deploy note

Set SYNC_GUILD_ID in the discord_bot deployment env to enable automatic sync. Existing global commands remain; guild commands shadow them. To clean up duplicates later, clear the guild tree once (!sync ^) and do a final global !sync.

@extreme4all
extreme4all merged commit 3cf8485 into develop Aug 29, 2026
7 checks passed
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.

1 participant