Discord Integration

Channel Management

Universal cross-guild channel verification via live fetchGuildChannels, native ChannelType.GuildCategory (4) support, and text, voice, and thread constraints.

Universal Cross-Guild Channel Verification (BOLA Prevention)

Every channel or category snowflake accepted by any of the 29 Taicket modules is verified against the target guildId before being written to MongoDB or used in a Discord REST dispatch. This eliminates cross-server channel injection (BOLA / IDOR) uniformly across configuration, panel deployment, rules scraping, and logging.

  1. 1

    Snowflake syntax validation

    Validates that both channelId and guildId match /^\d{17,20}$/. Malformed IDs fail immediately with VALIDATION_ERROR.

  2. 2

    Fast-path lookup via live fetchGuildChannels(guildId)

    Checks the guild channel list fetched from GET /api/v10/guilds/{guildId}/channels (cached 45 seconds in a bounded LRU cache with in-flight coalescing).

  3. 3

    Direct REST fallback for threads and newly created channels

    If the channel ID is not in the cached list (for example, an active thread or a channel created seconds earlier), Taicket calls GET /api/v10/channels/{channelId} and strictly asserts String(channel.guild_id) === String(guildId).

  4. 4

    Fail-closed cross-guild rejection

    Any channel belonging to another Discord guild raises CROSS_GUILD_RESOURCE (403) and is never persisted or dispatched to.

Discord Channel Types & Category Support (ChannelType.GuildCategory = 4)

Taicket validates not only guild ownership but also the Discord API v10 ChannelType integer enum so modules cannot bind incompatible channel types (such as assigning a voice channel as a ticket transcript log channel or a text channel as a ticket parent category).

ChannelType EnumValueValid Taicket Module Targets
GuildText0Ticket panels, AI support panels, verification panels, log channels, rules ingestion channels, welcome/goodbye channels, starboard, bump reminders, chatbot allowed channels
GuildVoice2Music voice channel binding, voice XP tracking exclusions, Pro/Enterprise ticket voice rooms
GuildCategory4Standard Ticket open/closed categories, AI Support Panel 1-3 open/closed categories, Verification category sync, Jail auto-setup category
GuildAnnouncement5Panel deployments, announcements, rules ingestion channels, starboard/welcome targets
PublicThread / PrivateThread / AnnouncementThread10 / 11 / 12Direct REST-verified thread targets where supported (not valid as parent categories)
GuildStageVoice13Excluded from text panel dispatches and standard ticket categories
GuildForum15Parent container for forum threads; cannot directly receive standard panel messages

Native Discord API v10 Category Selection

Discord API v10 natively supports selecting Category folders (ChannelType.GuildCategory = 4) both via REST parent_id fields and in interactive ChannelSelectMenuBuilder components with addChannelTypes(ChannelType.GuildCategory). get_server_topology returns categories with type: 4 alongside each child channel parentId.

Structural Auto-Setup & Cache Invalidation

Two modules support automated structural Discord setup over MCP: Pro Verification Gate auto-setup (configure_verification) and Jail System one-click auto-setup (configure_jail). Both create Discord categories, channels, roles, and channel permission overwrites.

Because structural creation mutates live Discord topology, both operations require the mcp:destructive scope AND completed human browser approval at /oauth/approve-action. Immediately after execution, Taicket calls invalidateGuildCache(guildId) so subsequent get_server_topology calls reflect the newly created channels and roles.

Related documentation