CopilotKitDocs
  • Docs
  • Reference
  • Cookbook
Get Enterprise Intelligence free
CopilotKitDocs
DocsReferenceCookbook
DocsReferenceCookbook

@copilotkit/bot

@copilotkit/bot-slack

@copilotkit/bot-discord

discordrenderComponentsdefaultDiscordToolsdefaultDiscordContextDISCORD_LIMITS
ReferencebotDiscord

defaultDiscordContext

The Discord context entries the adapter ships — tagging procedure, formatting (no tables, <@id>/<#id>), and the channel/thread/DM conversation model.


Overview

defaultDiscordContext is the list of Discord-specific ContextEntry values the package ships, meant to be spread into createBot({ context }). It is not auto-applied — you spread it explicitly. Each entry is also exported individually:

EntryTeaches the agent
discordTaggingContextHow to @-mention people: resolve via the lookup_discord_user tool and paste the returned <@id> mention verbatim; mention channels with <#CHANNEL_ID>
discordFormattingContextWhat formatting survives in Discord — standard Markdown (bold, italic, code, fenced blocks, headings, quotes) works, but Discord renders no tables — put tabular data in a fenced code block or call the appropriate render tool instead
discordConversationModelContextThe Discord conversation model — each channel, thread, and DM is one conversation; the bot replies in the same channel the message arrived in, and uses the read-history tool to see prior messages when it needs earlier context

Usage

import { defaultDiscordContext } from "@copilotkit/bot-discord";

const bot = createBot({
  // …
  context: [...defaultDiscordContext, ...myAppContext],
});

Context entries are folded into the agent's system context on every thread.runAgent(); per-run additions go through runAgent({ context }).

Related

  • defaultDiscordTools — the companion tool the tagging procedure relies on
  • createBot — the context option
  • discord() — the adapter
027b1de