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:
| Entry | Teaches the agent |
|---|---|
discordTaggingContext | How to @-mention people: resolve via the lookup_discord_user tool and paste the returned <@id> mention verbatim; mention channels with <#CHANNEL_ID> |
discordFormattingContext | What 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 |
discordConversationModelContext | The 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
contextoption - discord() — the adapter