Skip to content

fix: take the guild from the parent category, not from the sole server - #15

Merged
Akayashuu merged 1 commit into
masterfrom
fix/guild-from-parent
Aug 4, 2026
Merged

fix: take the guild from the parent category, not from the sole server#15
Akayashuu merged 1 commit into
masterfrom
fix/guild-from-parent

Conversation

@Akayashuu

Copy link
Copy Markdown
Collaborator

CreateUnder and EnsureUnder receive a parent category id — which fully determines the server — and then resolved the guild through Guilds().Sole anyway. For a bot in more than one server that is an error (bot is in N servers), so nesting a channel under a category was impossible.

They now read the guild off the parent (GET /channels/{parent}), and EnsureUnder creates directly with the id it already has rather than making CreateUnder look the parent up a second time. Net call count is unchanged for EnsureUnder (the sole-guild listing it used to make is now the parent fetch) and +1 for a bare CreateUnder.

Every other guild-scoped op is untouched: they still take an explicit guild, WithGuild, or the sole one.

Tests: the two EnsureUnder cases now feed the parent's guild, plus a case asserting nothing lists the bot's servers.

CreateUnder/EnsureUnder fell back to Guilds().Sole even though the parent
category id already names the server. A bot in several servers could not nest
a channel anywhere.
@Akayashuu
Akayashuu merged commit 77ed2ee into master Aug 4, 2026
1 check passed
@Akayashuu
Akayashuu deleted the fix/guild-from-parent 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