Prerequisites
- A Discord Developer Portal account
- A Discord bot with the Message Content privileged intent enabled
- Developer Mode turned on in Discord client settings (so you can copy channel IDs)
Setup
Create a Discord application and bot
Go to https://discord.com/developers/applications and click New Application. Give it a name, then navigate to the Bot tab and click Add Bot.
Enable the Message Content intent
Still on the Bot tab, scroll down to Privileged Gateway Intents and enable Message Content Intent. Without this, Discord will not deliver message text to your bot.
Copy the bot token
Under the Bot tab, click Reset Token (or Copy if one is already shown) and save the token securely.
Invite the bot to your server
Navigate to OAuth2 → URL Generator. Select the
bot scope and enable the Send Messages and Read Message History permissions. Copy the generated URL, paste it into your browser, and invite the bot to your server.Copy the channel IDs
In your Discord client, open User Settings → Advanced and enable Developer Mode. Then right-click any channel where you want Hiroshi to respond and choose Copy Channel ID.
Edit config.toml
Open Replace the token and channel ID with your own values. Add more channel ID strings to
~/.hiroshi/config.toml and add (or update) the [discord] section:allowed_channels to enable additional channels.Configuration fields
Set to
true to activate the Discord gateway. Defaults to false.Your Discord bot token from the Developer Portal.
Channel IDs (as strings) in which Hiroshi will read and respond to messages. Messages in any other channel are ignored. Defaults to an empty list.
The Discord gateway uses a persistent WebSocket connection to receive events from Discord in real time. This means no polling delay — messages are delivered to Hiroshi as soon as Discord dispatches them. If the connection drops, the daemon will automatically reconnect using exponential backoff.