ai-powered discord bot built with composio and vercel ai sdk. features multiple agents that handle different aspects of server automation and user interaction.
the bot runs four distinct agents that can be toggled individually:
- ping test - responds to
!ping
commands for testing bot connectivity - moderation - monitors support forum and introduction channels for content moderation
- support redirect - manages support requests and routes them to support team members
- star reply - uses ai to generate contextual responses when messages receive star reactions
- bun runtime
- discord bot token with message content intent enabled
- composio api key and auth config
- openrouter api key
create a .env
file in the project root:
DISCORD_BOT_TOKEN=your_discord_bot_token
COMPOSIO_APIKEY=your_composio_api_key
OPENROUTER_API_KEY=your_openrouter_api_key
SUPPORT_FORUM_CHANNEL_ID=your_channel_id
bun install
bun run dev
bun run start
edit the agent config in src/index.ts
:
await startAgents(client, {
supportForumChannelId: process.env.SUPPORT_FORUM_CHANNEL_ID,
introduceYourselfChannelId: "your_channel_id",
composioApiKey: process.env.COMPOSIO_APIKEY,
composioAuthConfigId: "your_auth_config_id",
userEmail: "your_email",
supportTeamUserIds: ["user_id_1", "user_id_2"],
});
src/index.ts
- main entry point and discord client setupsrc/agents/
- individual agent implementationssrc/lib/subscribe.ts
- message and reaction subscription systemsrc/lib/run-agent.ts
- utility for running agents standalone
each agent can be run independently for testing by executing its file directly with bun.
- discord.js for bot interactions
- composio for tool orchestration via mcp
- vercel ai sdk for llm integration
- openrouter for model access
- typescript and bun for runtime