Channels

Discord

Guild messages have no HTTP webhook in this SDK. Catalog inbound is socket onlycx.listen("discord"), not serve() or handle("discord").

Install

pip install 'caspian-sdk[discord]'
bun add caspian-sdk

Message Content Intent

In the Discord Developer Portal → bot → Privileged Gateway Intents → enable Message Content Intent. Without it, guild messages arrive with empty text and /help never matches. Invite with scope bot and the permissions you need.

export DISCORD_BOT_TOKEN='…'
bot.py
cx = Caspian()   # no Caspian key
cx.channels.add("discord", via="self-host", bot_token=token)
cx.listen("discord")
bot.ts
const cx = new Caspian()
await cx.channels.add("discord", { via: "self-host", bot_token: token })
await cx.listen("discord")

Hosted

Then channels.add("discord", via="hosted", display_name="Maya") may return an authorizeUrl to click. Inbound uses run() / handle("gateway", …), not listen. Python: Caspian(api_key=KEY). TypeScript: await cx.run({ apiKey: KEY }).

What it can do

Receive, reply, send, media, buttons, embeds, react, edit, delete, typing, modals, pin. The example uses overlap: "drop" on /typing so the indicator never queues behind a long reply — see Overlap.