IRC 设置
概述
IRC channel 把 Anyy 连接到 IRC network。它支持 private messages、channels、lifecycle startup 和 live-smoke 检查。
当前 IRC adapter 只处理文本。
前提条件
- IRC server host。
- Anyy 使用的 nick。
- 可选 password。
- 可选 TLS 和 port 设置。
- 如果要加入房间,准备 channel list。
配置
创建凭据
如果 IRC network 需要 NickServ 或 server password,把密码存为 Anyy secret。
配置 Anyy
anyy setup channels irc \
--set host=irc.example.net \
--set nick=anyy \
--write-config
带 password:
anyy setup channels irc \
--set host=irc.example.net \
--set nick=anyy \
--secret password='irc-password' \
--write-config
setup 默认值:
| 字段 | 默认值 |
|---|---|
account_id | network |
port | 6667 |
tls | false |
channels | [] |
dm_policy | open |
group_policy | mention |
send_chunk_chars | 400 |
列表字段请在 YAML 中编辑:
channels:
irc:
tls: true
port: 6697
channels:
- "#anyy"
mention_aliases:
- "anyy"
启动 Gateway
anyy gateway start
anyy channels reload
运行 Doctor 检查
anyy channels doctor irc
访问策略
私信
IRC 默认 dm_policy: open。需要更严格时,使用 allowlist,并写 nick 或 account id。
群组
IRC channels 默认 group_policy: mention。在 channel 中提到配置的 nick 或 alias。
管理员
IRC access policy 控制消息准入。命令权限由共享 messaging 层处理。
Sessions
每个 IRC 私信 peer 或 channel 映射到一个 Anyy session。
媒体支持
入站媒体
IRC 没有声明 inbound media 能力。
出站媒体
IRC 只发送文本回复。
命令
在私信中使用共享 messaging commands,或在 channel 中 mention Anyy。
Cron 投递
anyy cron create \
--name "IRC reminder" \
--schedule "30m" \
--prompt "Send the reminder" \
--delivery-target current_user_default \
--delivery-channel irc
故障排查
- 无法连接:检查 host、port、TLS 和 password。
- Channel 消息被忽略:mention nick 或配置 aliases。
- 长回复太吵:降低
send_chunk_chars。 - Nick 冲突:换一个
nick,然后 restart 或 reload channel。