Heypi connects to Discord through the Discord Gateway using discord.js. The adapter listens forDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/hunvreus/heypi/llms.txt
Use this file to discover all available pages before exploring further.
MessageCreate and InteractionCreate events, handles approval button clicks, and supports streaming responses. Message Content Intent must be explicitly enabled in the Developer Portal for the bot to read non-mention message text.
Create a Bot Application
Open the Discord Developer Portal
Go to https://discord.com/developers/applications and click New Application.
Enable Message Content Intent
On the Bot page, scroll to Privileged Gateway Intents and enable Message Content Intent. Without this, the bot will not receive the text of messages that do not mention it directly.
Required Gateway Intents
The heypi Discord adapter is initialized with the following intents via discord.js:| Intent | Purpose |
|---|---|
Guilds | Read server and channel metadata |
GuildMessages | Receive messages in server channels |
DirectMessages | Receive direct messages from users |
MessageContent | Read the full text of messages (requires privileged intent) |
Invite the Bot to a Server
Generate an invite URL with the required permissions:heypi discord check command also prints an invite URL once it connects.
Configure the Adapter
allow config filters those events after Discord delivers them — it does not replace Discord’s permission system.
Discover Guild and Channel IDs
The discovery commands connect directly to Discord usingDISCORD_BOT_TOKEN. They do not start the full heypi agent — they are lightweight tools for copying stable IDs into your configuration.
Conversation Model
Discord’s thread model is slightly different from other platforms:| Context | Conversation key |
|---|---|
| Thread channel (a channel that is itself a thread) | The thread’s own channelId |
| Normal text/announcement channel | The channel’s channelId |
| Direct message | The DM channel’s channelId |
threadTrigger option lets you control whether the bot responds to every message in a thread channel, or only when mentioned.
The Discord server (guild) ID is stored as the provider
team value in heypi’s thread records. You can use it in allow.guilds to restrict the bot to specific servers.Full Example
The following is the completeexamples/discord-project entry point — a project management bot with streaming, core tools, and an approval-gated status update:
CLI Commands
heypi discord check
Validates
DISCORD_BOT_TOKEN, prints the bot’s identity, and outputs an invite URL.heypi discord channels
Lists all text and announcement channels the bot can see, grouped by guild.
heypi discord invite
Generates an OAuth2 invite URL with the necessary bot permissions.
Common Failures
Used disallowed intents
Used disallowed intents
Message Content Intent is not enabled in the Discord Developer Portal. Go to your application’s Bot page, scroll to Privileged Gateway Intents, and enable Message Content Intent. You do not need to regenerate the token.
No messages arriving in channels
No messages arriving in channels
Verify that:
- Message Content Intent is enabled.
- The bot has been invited to the server with the correct permissions (use
heypi discord inviteto generate the URL). triggeris"mention"and the message actually @mentions the bot.allow.guildsandallow.channelsinclude the correct IDs (useheypi discord channelsto confirm).
Bot online but not responding to DMs
Bot online but not responding to DMs
allow.dms must be true to accept direct messages. Also confirm the bot has not blocked DMs in its Privacy Settings, and that the user sending the DM has a mutual server with the bot.Approval buttons not appearing
Approval buttons not appearing
Invalid Token error on startup
Invalid Token error on startup
The bot token is incorrect or has been reset. Re-copy the token from the Bot tab in the Developer Portal and update
DISCORD_BOT_TOKEN.