IRC
IRC Channel
Section titled “IRC Channel”Human can connect to IRC servers and participate in channels. The connection is bidirectional: it joins and receives messages over a raw TCP socket, and sends via PRIVMSG.
Prerequisites
Section titled “Prerequisites”- Build with
-DHU_ENABLE_IRC=ONor-DHU_ENABLE_ALL_CHANNELS=ON - Network access to the IRC server
Configuration
Section titled “Configuration”Add to ~/.human/config.json. IRC expects a channels.irc array of account configs:
{ "channels": { "irc": [ { "host": "irc.libera.chat", "port": 6667, "nick": "human", "channel": "#human", "tls": false, "allow_from": [] } ] }}Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
host | string | IRC server hostname (or server) |
port | number | Port (default 6667 for plain, 6697 for TLS) |
nick | string | IRC nickname |
channel | string | Channel to join (e.g. #channelname) |
tls | bool | Use TLS for connection (default false) |
allow_from | array | Nicknames or masks to allow. Empty = allow all |
Refer to src/channels/irc.c for the exact config schema. The implementation accepts server and port; nick and channel are used by the channel loop/dispatcher when connecting and joining.
How it works
Section titled “How it works”Connection
Section titled “Connection”- Resolves host via
getaddrinfo, connects with a streaming socket - Default port 6667 (plain) or 6697 (TLS)
- On start, the channel connects to the server; connection is kept open
Outbound (send)
Section titled “Outbound (send)”- Sends
PRIVMSG <target> :<message>\r\nover the socket - Long messages are split into chunks (max ~400 chars per line to stay under 512-byte IRC limit)
- Target is typically
#channelnameor a nickname for DMs
Inbound (receive)
Section titled “Inbound (receive)”- Polling-based: the channel loop reads from the socket
- Incoming PRIVMSG and NOTICE are parsed and delivered to the agent
- Poll interval: 1000 ms
Platform limitations
Section titled “Platform limitations”- Plain TCP by default: TLS support depends on build; current implementation may use raw sockets
- Single connection per config: Each array entry is one IRC connection
- No SASL/auth: Authentication (e.g. NickServ) is not built in; configure separately if required