discord
Search and read messages from Discord servers, list channels, send messages using a Discord bot, and connect personal Discord accounts via mautrix-discord Matrix bridge
Quick Install
npm install @openpets/discord pnpm add @openpets/discord Required Environment Variables
-
DISCORD_BOT_TOKENDiscord Bot Token from Discord Developer Portal
Available Tools (2)
These tools are available when you install the discord plugin in your AI assistant.
discord-generate-invite-url
Generate an OAuth2 invite URL to add the bot to a Discord server. Use this when the bot needs to be added to a new server.
discord-bot-status
Get the current bot status including connection info, application details, and which servers it has access to.
Example Queries
list all discord servers I have access to show me channels in the opencode discord get the last 20 messages from channel 1391832428024430645 search for messages containing 'help' in the server check my discord bridge connection status login to discord using my token list guilds available through the bridge Usage Scenarios
basic test
- 1
list discord guilds - 2
list channels in guild 1391832426048651334
Optional Configuration
| Variable | Description |
|---|---|
DISCORD_APPLICATION_ID | Discord Application ID - enables generating bot invite URLs |
DISCORD_PUBLIC_KEY | Discord Public Key - for webhook verification (if using interactions) |
DISCORD_ENABLE_POSTING | Set to 'true' to enable sending messages (disabled by default for safety) |
MAUTRIX_BRIDGE_URL | URL of your mautrix-discord bridge instance (e.g., https://discord-bridge.example.com). Enables Matrix bridge integration. |
MAUTRIX_SHARED_SECRET | Shared secret for mautrix-discord provisioning API. Found in bridge config under provisioning.shared_secret |
Use discord with Your AI Assistant
This open source plugin works with OpenCode-compatible AI assistants including ChatGPT, Claude, Perplexity, and other LLM-powered coding tools. Install the plugin and start using natural language to interact with discord.
Related Plugins
crisp
Access Crisp conversations, send messages, manage contacts, and handle customer support chats through the Crisp API
telegram
Interact with Telegram via Bot API or connect personal accounts through mautrix-telegram Matrix bridge
slack
Slack integration plugin for OpenCode - search channels, read messages, and post to Slack