mirror of
https://github.com/vercel/chat.git
synced 2026-09-14 18:32:29 +08:00
1348532068
* Update docs - Slack Assistants API, App Home tab, Stream stop blocks * Update README.md * Update package readmes, fix readme integration test * Add npm badges to all package READMEs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add test coverage to all packages * Create CODE_OF_CONDUCT.md * Create pull_request_template.md * Create issue templates * Create config.yml * Add unit tests for errors, singleton, logger, message, modals, gchat utils, and teams markdown Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add a vitest:workspace command * Misc URL fixes * Update CONTRIBUTING.md * Misc fixes, upgrade workflow/serde * Replace PII in integration test data --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1.1 KiB
1.1 KiB
@chat-adapter/discord
Discord adapter for Chat SDK. Supports HTTP Interactions and Gateway WebSocket for receiving messages.
Installation
npm install chat @chat-adapter/discord
Usage
import { Chat } from "chat";
import { createDiscordAdapter } from "@chat-adapter/discord";
const bot = new Chat({
userName: "mybot",
adapters: {
discord: createDiscordAdapter({
botToken: process.env.DISCORD_BOT_TOKEN!,
publicKey: process.env.DISCORD_PUBLIC_KEY!,
applicationId: process.env.DISCORD_APPLICATION_ID!,
}),
},
});
bot.onNewMention(async (thread, message) => {
await thread.post("Hello from Discord!");
});
Documentation
Full setup instructions, configuration reference, and features at chat-sdk.dev/docs/adapters/discord.
License
MIT