Skip to content

feat: add WithGuild to pin the default guild - #13

Merged
Akayashuu merged 1 commit into
masterfrom
feat/guild-option
Aug 4, 2026
Merged

feat: add WithGuild to pin the default guild#13
Akayashuu merged 1 commit into
masterfrom
feat/guild-option

Conversation

@Akayashuu

Copy link
Copy Markdown
Collaborator

Guilds().Sole errors as soon as the bot is in more than one server, and every guild-scoped op that takes "" goes through it — so a bot invited to a second guild loses slash-command registration with no way to say which server was meant.

WithGuild(id) pins the default guild on the client. It short-circuits resolveGuild before the sole-guild lookup, so it costs no network call and does not touch the memoized Sole path. An explicit per-call guild id still wins.

Tests: configured guild beats a two-server List (which still fails without it), and WithGuild threads through New.

Guild-scoped ops fell back to Guilds().Sole, which errors as soon as the bot
is in more than one server — command registration then fails outright with no
way to say which server was meant. WithGuild pins it without a network call.
@Akayashuu
Akayashuu merged commit c44c4cd into master Aug 4, 2026
1 check passed
@Akayashuu
Akayashuu deleted the feat/guild-option 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