/** * Discord integration — low-level API-wrapper skill. * * Lets an agent post messages into a Discord server the user's bot has been * invited to, and discover the channels it can post to. Talks the Discord * REST API (v10) directly with a static BOT token — no MCP server of its own; * served over the GENERIC skill MCP binary (bin/mcp-skill.mjs), exactly like * linear.js / github.js. * * AUTH (single chokepoint: resolveDiscordAuth): * 1. resolveIntegrationToken('discord') — the Zibby-cloud path. The backend * stores the bot token on the account's provider='discord' integration * row (paste-based connect) and returns { token, guildId } from * GET /integrations/token/discord. * 2. DISCORD_BOT_TOKEN env — the self-host / local fallback (same pattern * as linear.js's LINEAR_API_KEY): when the env token is present it wins, * so a self-hosted run never needs the Zibby cloud at all. * * Discord auth header semantics (https://discord.com/developers/docs): * Authorization: Bot * A raw token pasted without the "Bot " prefix gets it added here. * * FAIL-SOFT: handleToolCall never throws — every error path returns * JSON.stringify({ ok:false, error }) so a notify step can't crash a workflow. * * Discord hard limit: message `content` is capped at 2000 chars — longer text * is CHUNKED into sequential messages (split on line boundaries when possible) * rather than truncated or rejected. */ export declare const DISCORD_MAX_CONTENT = 2000; /** * Split `text` into Discord-postable chunks of <= DISCORD_MAX_CONTENT chars. * Prefers newline boundaries so code blocks / paragraphs stay readable; falls * back to a hard slice for a single overlong line. Pure — exported for tests. * * @param {string} text * @param {number} [max=DISCORD_MAX_CONTENT] * @returns {string[]} non-empty chunks (empty input → []). */ export declare function chunkDiscordContent(text: any, max?: number): any[]; export declare const discordSkill: any;