Discord
Discord Channel
Section titled “Discord Channel”Human can run as a Discord bot using the Discord API.
Prerequisites
Section titled “Prerequisites”- Build with
-DHU_ENABLE_DISCORD=ONor-DHU_ENABLE_ALL_CHANNELS=ON - A Discord account and server
1. Create a Discord application
Section titled “1. Create a Discord application”- Go to Discord Developer Portal
- Click New Application, name it, create
- Open Bot in the sidebar
- Click Add Bot
- Copy the token (click Reset Token if needed)
- Enable Message Content Intent (Privileged Gateway Intents) if the bot needs to read message content
- Note your Application ID (General Information)
2. Invite the bot
Section titled “2. Invite the bot”Use this URL (replace YOUR_CLIENT_ID with your Application ID):
https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=274877975552&scope=botPermissions include: Send Messages, Read Message History, Read Messages/View Channels.
3. Configuration
Section titled “3. Configuration”Add to ~/.human/config.json:
{ "channels": { "discord": [ { "token": "MTIzNDU2Nzg5MDEyMzQ1Njc4.ABcdEF.GhijKlmnOpqrstUvWxYz", "guild_id": "1234567890123456789", "allow_from": [], "allow_bots": false } ] }}Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
token | string | Bot token from Developer Portal |
guild_id | string | Discord server (guild) ID |
allow_from | array | User IDs allowed to interact. Empty = allow all |
allow_bots | bool | Whether to respond to other bots (default: false) |
Get guild ID
Section titled “Get guild ID”Enable Developer Mode in Discord (Settings → App Settings → Advanced → Developer Mode). Right-click your server icon → Copy Server ID.
4. Webhook
Section titled “4. Webhook”Incoming Discord events are received at the gateway path /webhook/discord or /discord. Configure your bot’s interaction endpoint or use a compatible event gateway.
5. Run
Section titled “5. Run”Start the gateway and ensure the Discord channel is configured. The bot will connect and respond in the configured guild.