{"id":600,"date":"2026-03-21T22:52:56","date_gmt":"2026-03-21T14:52:56","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/channels-irc\/"},"modified":"2026-03-21T23:28:47","modified_gmt":"2026-03-21T15:28:47","slug":"channels-irc","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/channels-irc\/","title":{"rendered":"IRC"},"content":{"rendered":"<h1>IRC<\/h1>\n<p>Use IRC when you want OpenClaw in classic \u6e20\u9053s (<code>#room<\/code>) and direct messages.<br \/>\nIRC ships as an extension plugin, but it is configured in the main config under <code>channels.irc<\/code>.<\/p>\n<h2>\u5feb\u901f\u5f00\u59cb<\/h2>\n<ol>\n<li>Enable IRC config in <code>~\/.openclaw\/openclaw.json<\/code>.<\/li>\n<li>Set at least:<\/li>\n<\/ol>\n<p>&#8220;`json5  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  \u6e20\u9053s: {<br \/>\n    irc: {<br \/>\n      enabled: true,<br \/>\n      host: &#8220;irc.libera.chat&#8221;,<br \/>\n      port: 6697,<br \/>\n      tls: true,<br \/>\n      nick: &#8220;openclaw-bot&#8221;,<br \/>\n      \u6e20\u9053s: [&#8220;#openclaw&#8221;],<br \/>\n    },<br \/>\n  },<br \/>\n}<\/p>\n<pre><code>\n3. Start\/restart gateway:\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nopenclaw gateway run\n<\/code><\/pre>\n<h2>Security defaults<\/h2>\n<ul>\n<li><code>channels.irc.dmPolicy<\/code> defaults to <code>\"pairing\"<\/code>.<\/li>\n<li><code>channels.irc.groupPolicy<\/code> defaults to <code>\"allowlist\"<\/code>.<\/li>\n<li>With <code>groupPolicy=\"allowlist\"<\/code>, set <code>channels.irc.groups<\/code> to define allowed \u6e20\u9053s.<\/li>\n<li>Use TLS (<code>channels.irc.tls=true<\/code>) unless you intentionally accept plaintext transport.<\/li>\n<\/ul>\n<h2>Access control<\/h2>\n<p>There are two separate \u201cgates\u201d for IRC \u6e20\u9053s:<\/p>\n<ol>\n<li><strong>Channel access<\/strong> (<code>groupPolicy<\/code> + <code>groups<\/code>): whether the bot accepts messages from a \u6e20\u9053 at all.<\/li>\n<li><strong>Sender access<\/strong> (<code>groupAllowFrom<\/code> \/ per-\u6e20\u9053 <code>groups[\"#channel\"].allowFrom<\/code>): who is allowed to trigger the bot inside that \u6e20\u9053.<\/li>\n<\/ol>\n<p>Config keys:<\/p>\n<ul>\n<li>DM allowlist (DM sender access): <code>channels.irc.allowFrom<\/code><\/li>\n<li>Group sender allowlist (\u6e20\u9053 sender access): <code>channels.irc.groupAllowFrom<\/code><\/li>\n<li>Per-\u6e20\u9053 controls (\u6e20\u9053 + sender + mention rules): <code>channels.irc.groups[\"#channel\"]<\/code><\/li>\n<li><code>channels.irc.groupPolicy=\"open\"<\/code> allows unconfigured \u6e20\u9053s (<strong>still mention-gated by default<\/strong>)<\/li>\n<\/ul>\n<p>Allowlist entries should use stable sender identities (<code>nick!user@host<\/code>).<br \/>\nBare nick matching is mutable and only enabled when <code>channels.irc.dangerouslyAllowNameMatching: true<\/code>.<\/p>\n<h3>Common gotcha: <code>allowFrom<\/code> is for DMs, not \u6e20\u9053s<\/h3>\n<p>If you see logs like:<\/p>\n<ul>\n<li><code>irc: drop group sender alice!ident@host (policy=allowlist)<\/code><\/li>\n<\/ul>\n<p>\u2026it means the sender wasn\u2019t allowed for <strong>group\/\u6e20\u9053<\/strong> messages. Fix it by either:<\/p>\n<ul>\n<li>setting <code>channels.irc.groupAllowFrom<\/code> (global for all \u6e20\u9053s), or<\/li>\n<li>setting per-\u6e20\u9053 sender allowlists: <code>channels.irc.groups[\"#channel\"].allowFrom<\/code><\/li>\n<\/ul>\n<p>Example (allow anyone in <code>#tuirc-dev<\/code> to talk to the bot):<\/p>\n<p>&#8220;`json55  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  \u6e20\u9053s: {<br \/>\n    irc: {<br \/>\n      groupPolicy: &#8220;allowlist&#8221;,<br \/>\n      groups: {<br \/>\n        &#8220;#tuirc-dev&#8221;: { allowFrom: [&#8220;*&#8221;] },<br \/>\n      },<br \/>\n    },<br \/>\n  },<br \/>\n}<\/p>\n<pre><code>\n## Reply triggering (mentions)\n\nEven if a channel is allowed (via `groupPolicy` + `groups`) and the sender is allowed, OpenClaw defaults to **mention-gating** in group contexts.\n\nThat means you may see logs like `drop channel \u2026 (missing-mention)` unless the message includes a mention pattern that matches the bot.\n\nTo make the bot reply in an IRC channel **without needing a mention**, disable mention gating for that channel:\n\n```json55  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  channels: {\n    irc: {\n      groupPolicy: &quot;allowlist&quot;,\n      groups: {\n        &quot;#tuirc-dev&quot;: {\n          requireMention: false,\n          allowFrom: [&quot;*&quot;],\n        },\n      },\n    },\n  },\n}\n<\/code><\/pre>\n<p>Or to allow <strong>all<\/strong> IRC \u6e20\u9053s (no per-\u6e20\u9053 allowlist) and still reply without mentions:<\/p>\n<p>&#8220;`json55  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  \u6e20\u9053s: {<br \/>\n    irc: {<br \/>\n      groupPolicy: &#8220;open&#8221;,<br \/>\n      groups: {<br \/>\n        &#8220;<em>&#8220;: { requireMention: false, allowFrom: [&#8220;<\/em>&#8220;] },<br \/>\n      },<br \/>\n    },<br \/>\n  },<br \/>\n}<\/p>\n<pre><code>\n## Security note (recommended for public channels)\n\nIf you allow `allowFrom: [&quot;*&quot;]` in a public channel, anyone can prompt the bot.\nTo reduce risk, restrict tools for that channel.\n\n### Same tools for everyone in the channel\n\n```json55  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  channels: {\n    irc: {\n      groups: {\n        &quot;#tuirc-dev&quot;: {\n          allowFrom: [&quot;*&quot;],\n          tools: {\n            deny: [&quot;group:runtime&quot;, &quot;group:fs&quot;, &quot;gateway&quot;, &quot;nodes&quot;, &quot;cron&quot;, &quot;browser&quot;],\n          },\n        },\n      },\n    },\n  },\n}\n<\/code><\/pre>\n<h3>Different tools per sender (owner gets more power)<\/h3>\n<p>Use <code>toolsBySender<\/code> to apply a stricter policy to <code>\"*\"<\/code> and a looser one to your nick:<\/p>\n<p>&#8220;`json55  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n{<br \/>\n  \u6e20\u9053s: {<br \/>\n    irc: {<br \/>\n      groups: {<br \/>\n        &#8220;#tuirc-dev&#8221;: {<br \/>\n          allowFrom: [&#8220;<em>&#8220;],<br \/>\n          toolsBySender: {<br \/>\n            &#8220;<\/em>&#8220;: {<br \/>\n              deny: [&#8220;group:runtime&#8221;, &#8220;group:fs&#8221;, &#8220;\u7f51\u5173&#8221;, &#8220;nodes&#8221;, &#8220;cron&#8221;, &#8220;browser&#8221;],<br \/>\n            },<br \/>\n            &#8220;id:eigen&#8221;: {<br \/>\n              deny: [&#8220;\u7f51\u5173&#8221;, &#8220;nodes&#8221;, &#8220;cron&#8221;],<br \/>\n            },<br \/>\n          },<br \/>\n        },<br \/>\n      },<br \/>\n    },<br \/>\n  },<br \/>\n}<\/p>\n<pre><code>\nNotes:\n\n* `toolsBySender` keys should use `id:` for IRC sender identity values:\n  `id:eigen` or `id:eigen!~eigen@174.127.248.171` for stronger matching.\n* Legacy unprefixed keys are still accepted and matched as `id:` only.\n* The first matching sender policy wins; `&quot;*&quot;` is the wildcard fallback.\n\nFor more on group access vs mention-gating (and how they interact), see: [\/channels\/groups](\/channels\/groups).\n\n## NickServ\n\nTo identify with NickServ after connect:\n\n```json5  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  channels: {\n    irc: {\n      nickserv: {\n        enabled: true,\n        service: &quot;NickServ&quot;,\n        password: &quot;your-nickserv-password&quot;,\n      },\n    },\n  },\n}\n<\/code><\/pre>\n<p>\u53ef\u9009\u9879 one-time registration on connect:<\/p>\n<p><code>json5  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}<br \/>\n{<br \/>\n  channels: {<br \/>\n    irc: {<br \/>\n      nickserv: {<br \/>\n        register: true,<br \/>\n        registerEmail: \"bot@example.com\",<br \/>\n      },<br \/>\n    },<br \/>\n  },<br \/>\n}<\/code><\/p>\n<p>Disable <code>register<\/code> after the nick is registered to avoid repeated REGISTER attempts.<\/p>\n<h2>Environment variables<\/h2>\n<p>Default account supports:<\/p>\n<ul>\n<li><code>IRC_HOST<\/code><\/li>\n<li><code>IRC_PORT<\/code><\/li>\n<li><code>IRC_TLS<\/code><\/li>\n<li><code>IRC_NICK<\/code><\/li>\n<li><code>IRC_USERNAME<\/code><\/li>\n<li><code>IRC_REALNAME<\/code><\/li>\n<li><code>IRC_PASSWORD<\/code><\/li>\n<li><code>IRC_CHANNELS<\/code> (comma-separated)<\/li>\n<li><code>IRC_NICKSERV_PASSWORD<\/code><\/li>\n<li><code>IRC_NICKSERV_REGISTER_EMAIL<\/code><\/li>\n<\/ul>\n<h2>\u6545\u969c\u6392\u67e5<\/h2>\n<ul>\n<li>If the bot connects but never replies in \u6e20\u9053s, verify <code>channels.irc.groups<\/code> <strong>and<\/strong> whether mention-gating is dropping messages (<code>missing-mention<\/code>). If you want it to reply without pings, set <code>requireMention:false<\/code> for the \u6e20\u9053.<\/li>\n<li>If login fails, verify nick availability and server password.<\/li>\n<li>If TLS fails on a custom network, verify host\/port and certificate setup.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>IRC Use IRC when you want OpenClaw in classic \u6e20\u9053s (#roo [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-600","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=600"}],"version-history":[{"count":3,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/600\/revisions"}],"predecessor-version":[{"id":810,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/600\/revisions\/810"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}