Skip to content

feat: WithGlobalCommands registers slash commands app-wide - #14

Merged
Akayashuu merged 1 commit into
masterfrom
feat/global-commands
Aug 4, 2026
Merged

feat: WithGlobalCommands registers slash commands app-wide#14
Akayashuu merged 1 commit into
masterfrom
feat/global-commands

Conversation

@Akayashuu

Copy link
Copy Markdown
Collaborator

commandsBase always resolved a guild, so every command op (Register, List, Create, Edit, Delete, Registry.Sync) targeted exactly one server — and failed outright once the bot was in more than one, since the fallback is Guilds().Sole.

WithGlobalCommands() scopes them to the application instead: /applications/{app}/commands. Every server the bot is in gets them, and the guild lookup is skipped, not merely satisfied.

Guild scope stays the default — guild commands appear instantly where global ones take up to an hour to propagate, which is what you want while iterating. Nothing else that resolves a guild (channels, members, roles) is affected.

Tests: the default base is still the guild path, the global base is the application path and issues no /users/@me/guilds call, and the option reaches the client through New.

Commands were always written to one guild, so a bot meant to be installed on
several servers could only ever expose them on one — and the guild lookup fails
outright past the first server. Global scope skips that lookup entirely.
@Akayashuu
Akayashuu merged commit cce89b1 into master Aug 4, 2026
1 check passed
@Akayashuu
Akayashuu deleted the feat/global-commands branch August 4, 2026 18:41
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