Summary
Add IRC as a new picoclaw channel (pkg/channels/irc/), enabling bots to connect to IRC servers, join channels, respond to mentions, and handle DMs.
Motivation
IRC remains widely used in open-source, DevOps, and technical communities. Adding IRC support would let picoclaw bots serve users on Libera.Chat, OFTC, private IRC networks, and self-hosted servers (Ergo, UnrealIRCd, etc.) alongside existing channels like Discord, Telegram, and Slack.
Proposed Design
Follow the existing channel pattern (embed BaseChannel, implement Channel interface, register via init() factory).
Config
{
"channels": {
"irc": {
"enabled": true,
"server": "irc.libera.chat:6697",
"tls": true,
"nick": "mybot",
"password": "",
"nickserv_password": "",
"sasl_user": "",
"sasl_password": "",
"channels": ["#mychannel"],
"allow_from": [],
"group_trigger": { "mention_only": true }
}
}
}
Library
github.com/ergochat/irc-go — specifically ircevent for connection management, reconnection, PING/PONG keepalive, and SASL. Maintained by the Ergo IRC server team.
Key behaviors
- Auth: SASL > NickServ > server password (in priority order)
- Inbound:
PRIVMSG events → parse nick/target/content → DM vs channel → mention detection → HandleMessage
- Outbound:
conn.Privmsg(target, line) — split on newlines, respect 512-byte IRC line limit via WithMaxMessageLength(400)
- Reconnection: Handled by
ircevent.Connection.Loop() with built-in backoff
- Mention detection:
nick: / nick, prefix (standard IRC convention) + word-boundary match. Uses conn.CurrentNick() to handle nick collisions
- Rate limiting:
"irc": 2 in channelRateConfig (~2 msg/sec, safe for most networks)
Not implemented
IRC doesn't support typing indicators, message editing, placeholders, streaming, reactions, or media uploads — so none of the optional capability interfaces apply.
Files
| Action |
File |
| Modify |
pkg/config/config.go — add IRCConfig struct + field to ChannelsConfig |
| Modify |
pkg/channels/manager.go — add rate config + initChannel block |
| Modify |
cmd/picoclaw/internal/gateway/helpers.go — add blank import |
| Create |
pkg/channels/irc/init.go — factory registration |
| Create |
pkg/channels/irc/irc.go — struct, constructor, Start/Stop/Send |
| Create |
pkg/channels/irc/handler.go — PRIVMSG handler, mention helpers |
Happy to submit a PR for this if there's interest.
Summary
Add IRC as a new picoclaw channel (
pkg/channels/irc/), enabling bots to connect to IRC servers, join channels, respond to mentions, and handle DMs.Motivation
IRC remains widely used in open-source, DevOps, and technical communities. Adding IRC support would let picoclaw bots serve users on Libera.Chat, OFTC, private IRC networks, and self-hosted servers (Ergo, UnrealIRCd, etc.) alongside existing channels like Discord, Telegram, and Slack.
Proposed Design
Follow the existing channel pattern (embed
BaseChannel, implementChannelinterface, register viainit()factory).Config
{ "channels": { "irc": { "enabled": true, "server": "irc.libera.chat:6697", "tls": true, "nick": "mybot", "password": "", "nickserv_password": "", "sasl_user": "", "sasl_password": "", "channels": ["#mychannel"], "allow_from": [], "group_trigger": { "mention_only": true } } } }Library
github.com/ergochat/irc-go— specificallyirceventfor connection management, reconnection, PING/PONG keepalive, and SASL. Maintained by the Ergo IRC server team.Key behaviors
PRIVMSGevents → parse nick/target/content → DM vs channel → mention detection →HandleMessageconn.Privmsg(target, line)— split on newlines, respect 512-byte IRC line limit viaWithMaxMessageLength(400)ircevent.Connection.Loop()with built-in backoffnick:/nick,prefix (standard IRC convention) + word-boundary match. Usesconn.CurrentNick()to handle nick collisions"irc": 2inchannelRateConfig(~2 msg/sec, safe for most networks)Not implemented
IRC doesn't support typing indicators, message editing, placeholders, streaming, reactions, or media uploads — so none of the optional capability interfaces apply.
Files
pkg/config/config.go— addIRCConfigstruct + field toChannelsConfigpkg/channels/manager.go— add rate config +initChannelblockcmd/picoclaw/internal/gateway/helpers.go— add blank importpkg/channels/irc/init.go— factory registrationpkg/channels/irc/irc.go— struct, constructor, Start/Stop/Sendpkg/channels/irc/handler.go— PRIVMSG handler, mention helpersHappy to submit a PR for this if there's interest.