Discord Integration

Server Discovery

Live Discord guild filtering, bot presence correlation, delegated role discovery, and output schema of get_discord_servers.

Live Guild Filtering Pipeline

When a user loads /oauth/consent, opens /account, or invokes get_discord_servers, Taicket computes the exact list of Discord servers the authenticated user can access by combining live Discord REST API v10 guild ownership/permission flags with delegated Taicket database records.

  1. 1

    Fetch user guilds from Discord API v10

    Calls GET /api/v10/users/@me/guilds using the caller encrypted Discord OAuth token (bounded 2-minute LRU cache keyed by SHA-256(accessToken) with in-flight request coalescing and stale-fallback on transient Discord errors).

  2. 2

    Filter real administrative guilds

    Evaluates BigInt permission flags on every guild: retains servers where guild.owner === true, (perms & 0x8n) === 0x8n (ADMINISTRATOR), or (perms & 0x20n) === 0x20n (MANAGE_GUILD).

  3. 3

    Correlate delegated database access

    Queries Taicket databases for servers where ctx.userId holds delegated access without full Discord Admin bits: GuildConfig.tempAdminUserIds, AntiNukeTrustedUser (active and unexpired), AntiNukeGuildConfig.emergencyOperatorIds, InterviewConfig.interviewerUserIds, ServerDashboardConfig staff/department roles, or ComponentBuilderConfig delegates.

  4. 4

    Cross-reference bot installation status

    Compares discovered guild IDs against fetchBotGuilds (cached 60 seconds) to mark botInstalled: true | false and generate an exact single-guild bot invite URL whenever Taicket is not yet installed.

  5. 5

    Intersect with token allowedGuildIds & BotBlacklist

    When invoked over /mcp with a server-scoped grant or PAT, strips any guild not present in tokenRecord.allowedGuildIds and flags or omits globally blacklisted guilds.

get_discord_servers Output Structure

Sample get_discord_servers structuredContent responsejson
{
  "ok": true,
  "scopeMode": "selected_servers",
  "servers": [
    {
      "guildId": "1189452019384729600",
      "name": "Acme Support Community",
      "botInstalled": true,
      "tier": "pro",
      "permissions": {
        "isOwner": false,
        "isRealAdmin": true,
        "isTempAdmin": false,
        "canAccessServerSettings": true,
        "canAccessAntiNuke": false,
        "canAccessGeneralModules": true,
        "canAccessInterviews": true,
        "canAccessServerDashboard": true,
        "canAccessComponentBuilder": true
      },
      "inviteUrl": null
    },
    {
      "guildId": "1204918273645501920",
      "name": "Acme Staging Server",
      "botInstalled": false,
      "tier": "free",
      "permissions": {
        "isOwner": true,
        "isRealAdmin": true,
        "isTempAdmin": false,
        "canAccessServerSettings": true,
        "canAccessAntiNuke": true,
        "canAccessGeneralModules": true,
        "canAccessInterviews": true,
        "canAccessServerDashboard": true,
        "canAccessComponentBuilder": true
      },
      "inviteUrl": "https://discord.com/oauth2/authorize?client_id=1423500000000000000&permissions=395471875160&scope=bot%20applications.commands&guild_id=1204918273645501920&disable_guild_select=true"
    }
  ]
}

Related documentation