Skip to content

fix(discord_bot): guild-only sync command + global command cleanup - #189

Merged
extreme4all merged 1 commit into
developfrom
fix/discord-bot-guild-only-sync
Aug 29, 2026
Merged

fix(discord_bot): guild-only sync command + global command cleanup#189
extreme4all merged 1 commit into
developfrom
fix/discord-bot-guild-only-sync

Conversation

@extreme4all

Copy link
Copy Markdown
Contributor

Problem

Slash commands appeared twice in Discord's command picker. Startup syncs the command tree to SYNC_GUILD_ID (guild-scoped), but a global sync (e.g. the old bare !sync / tree.sync()) had also registered every command globally. Discord shows global + guild-scoped copies side by side.

Changes

  • !sync is now guild-only: bare / ~ / * / ^ all sync the current guild only; the global tree.sync() path is removed so globals cannot be re-created.
  • New !sync ! spec: fetches all globally registered commands from the API and deletes them (one-time cleanup for the stale duplicates).
  • Startup guild sync (sync_command_tree) is unchanged.

Usage

After deploy, run !sync ! once as bot owner to delete the stale global commands.

Verification

  • uv run ruff check / ruff format --check . clean
  • uv run pytest: 140 passed
  • uv run mypy: same 7 pre-existing errors as develop, none introduced

@extreme4all
extreme4all merged commit 6cd1703 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