Eggdrop 1.10.2 常用 CLI 命令与工具详解

实测讲清 Eggdrop 1.10.2 三层命令体系:二进制启动参数(-m/-t/-c/-h/-v)、autobotchk 看门狗与 partyline .命令族(.status/.rehash/.+chan/.tcl 等)的权限层级与典型运维场景。

EggdropEggdropIRC即时通信CLI命令运维2026/10/25

Eggdrop 1.10.2 常用 CLI 命令与工具详解

目标:实测讲清 Eggdrop 1.10.2 的三层命令体系——eggdrop 二进制启动参数、partyline . 命令族(机器人管理主入口)、autobotchk 看门狗工具。全文命令与回显均在 Ubuntu 22.04.5 LTS + Eggdrop 1.10.2(源码编译)实例上逐条执行照抄,可直接照做复现。

一、环境信息

  • 操作系统:Ubuntu 22.04.5 LTS(Jammy),x86_64
  • 软件版本:Eggdrop 1.10.2(2026-09-06 稳定版,安装于 /opt/eggdrop)
  • 管理通道:telnet 登录 partyline(端口 3333),账号 admin(owner 权限)
  • 联调环境:本地 ngIRCd 26.1(127.0.0.1:6667),测试频道 #eggdrop-test

二、前置条件

  • 已按《Ubuntu 22.04 安装 Eggdrop 1.10.2 指南》装好并首启成功,持有 owner 账号。
  • 已按该文 FAQ 在配置中声明 set owner "admin" 并 .rehash(否则 .tcl/.set 不可用)。
  • 知道 partyline 的进入方式:telnet <主机> 3333,输入 handle 与密码登录。

三、命令体系总览

Eggdrop 的「命令」分三层,别混淆:

层级形态用途
二进制 CLIeggdrop [-c|-t|-m|-h|-v] [配置文件]进程启动/首初始化/查版本
partyline 命令以 . 开头(如 .status)机器人运行时全部管理操作
辅助工具scripts/autobotchk崩溃看门狗,生成 cron/systemd 单元

partyline 规则:登录后不以 . 开头的输入都当作 partyline 聊天广播,命令必须以 . 开头(.quit、.help)。

四、eggdrop 二进制命令行参数

4.1 帮助与版本(-h / -v)

/opt/eggdrop/eggdrop -h

实测回显(全部 5 个参数):

Eggdrop v1.10.2 (C) 1997 Robey Pointer (C) 1999-2025 Eggheads Development Team

Usage: ./eggdrop [options] [config-file]

Options:
-c  Don't background; display channel stats every 10 seconds.
-t  Don't background; use terminal to simulate DCC chat.
-m  Create userfile.
-h  Show this help and exit.
-v  Show version info and exit.
/opt/eggdrop/eggdrop -v
Eggdrop v1.10.2 (C) 1997 Robey Pointer (C) 1999-2025 Eggheads Development Team
Configure flags: none
Compiled with: IPv6, TLS, Threaded DNS core, handlen=32

4.2 运行参数(-m / -c / -t)

参数作用使用场景
-m创建用户库模式仅首次启动用,等待首个管理员经 telnet 输入 NEW 或 IRC /msg 机器人 hello 注册为 owner;用户库建成后永久不要再用
无参数后台常驻日常运行的标准形态(systemd 托管即此形态)
-c前台运行,每 10 秒刷频道统计调试频道问题时观察实时状态
-t前台运行,用终端模拟 DCC chat无 telnet 条件的紧急本地排障

⚠️ 注意:-m 再次用于已有用户库的配置会让机器人重新进入「等待注册」状态,正常启动永远只带配置文件:./eggdrop testbot.conf。

4.3 autobotchk 看门狗

scripts/autobotchk 生成 cron 或用户级 systemd 单元,定时检查并拉起崩溃的机器人:

./scripts/autobotchk testbot.conf -systemd -unitname eggdrop-testbot

用法实测输出(节选):

autobotchk 1.11, (C) 1999-2003 Jeff Fisher (guppy@eggheads.org)
                   (C) 2004-2022 Eggheads Development Team
usage: ./scripts/autobotchk <eggdrop mainconfig> [options] [additional configs]
 systemd options:
  -systemd (install systemd job instead of cron)
  -unitname <name> (specify systemd unit name, implies -systemd)
 crontab options:
  -dir     (directory to run autobotchk in)
  -noemail (discard crontab e-mails)
  -5 / -10 / -15 / -30  (N minute checks)

要点:systemd 模式生成用户级单元且要求 linger 已开启(loginctl enable-linger eggdrop);cron 模式按 5/10/15/30 分钟周期检查。生产环境更推荐系统级 systemd 单元(见安装篇第七节)。

五、partyline 命令族

5.1 命令全景:.help 体系

partyline 内置分级帮助:.help(基础)、.help <命令>(单个命令详情)、.help all(全量命令树)、.help *关键词*(模糊搜索帮助文本)。实测 .help all 输出的完整命令树(按权限分组照抄):

.help all
###  core commands
   For all users:
      who          away         quit         whom
      me           page         match        motd
      bots         newpass      chat         handle
      whoami       echo         strip        su
      trace        fixcodes     bottree      vbottree
      botinfo      relay        -host        fprint
      chfinger
   For ops:
      addlog       console      match        whois
   For botnet masters:
      +bot         botattr      chhandle     chpass
      +host        -bot         link         chaddr
      boot         unlink       banner       dccstat
   For channel masters:
      chattr       save         backup       reload
      status       traffic      uptime
   For global masters:
      +user        +ignore      comment      binds
      ignores      -user        -ignore      dccstat
      debug        rehash       restart      module
   For owners:
      die          simul        loadmod      unloadmod
      language     set          tcl          rehelp
      modules      +lang        -lang        +lsec
      -lsec        lstat        relang       ldump
###  irc module commands(节选)
   For channel ops:
      act          halfop       say          topic        op ...
   For channel masters:
      adduser      deluser      reset
###  server module commands(节选)
      servers      jump         dump         clearqueue
###  channels module commands(节选)
   For channel ops or halfops:
      +ban         +extban      -ban         bans         stick
      +exempt      -exempt      exempts      unstick
      +invite      -invite      invites
   For global owners:
      +chan        -chan

💡 命令可用性与权限严格挂钩:同一命令在不同权限组出现次数不同;权限不足时机器人一律装傻回 What? You need '.help'(实测,见 5.9)。

5.2 会话与状态查询

.who 查看 partyline 在线成员(* owner、+ master、% botmaster、@ op、^ halfop):

.who
Party line members: (* = owner, + = master, % = botmaster, @ = op, ^ = halfop)
  [07]  *admin     telnet@localhost (con:mkcoblxs)

.whoami / .uptime / .bots / .motd:

.whoami
You are admin@eggtestbot.
.uptime
Online for 00:05  (background)
.bots
No bots linked.

.motd 输出登录欢迎横幅(ASCII logo、版本、运行系统、本地时间等,内容来自 text/motd 可自定义)。

.status 是最重要的体检命令,一次输出版本/内存/在线时长/配置文件/Tcl/TLS/模块/频道全貌:

.status
I am eggtestbot, running eggdrop v1.10.2: 1 user (mem: 91k).
Online for 00:04 (background) - CPU: 00:00.02 - Cache hit: 41.2%
Config file: testbot.conf
Tcl version: 8.6.12 (header version 8.6.12)
Tcl is threaded.
TLS support is enabled.
IPv6 support is enabled.
Threaded DNS core is enabled.
Loaded module information:
    Channels: #eggdrop-test
    Connected to (null) [127.0.0.1]:6667 (connected for 00:01)
    #eggdrop-test       :   1 member, enforcing "+tn" (greet)

💡 还有更强的 .status all(含 CAP 协商细节),排障网络问题时优先用它。

.console 查询/修改本人控制台订阅的事件类别:

.console
Your console is #eggdrop-test: mkcoblxs (msgs, kicks/modes, cmds, misc, bots, linked bot msgs, files, server input).

.modules 列出已加载模块及版本:

.modules
Modules loaded:
  Module: uptime (v1.4)
  Module: console (v1.3)
  Module: notes (v2.2)
  Module: irc (v1.5)
  Module: ctcp (v1.1)
  Module: server (v1.5)
  Module: channels (v1.2)
  Module: encryption (v2.2)
  Module: encryption2 (v1.0)
  Module: eggdrop (v110.2)
End of modules list.

5.3 用户管理(.+user / .whois / .chattr / .-user)

新增用户(指定主机掩码):

.+user testuser *!*@testuser.example.com
Added testuser (*!*@testuser.example.com) with no password and no flags.

查看用户:

.whois testuser
HANDLE                           PASS NOTES FLAGS           LAST
testuser                         no       0 -               never (nowhere)
  HOSTS: *!*@testuser.example.com

授权(+fo = friend + op;实测机器人自动补了 +l 半op 标志):

.chattr testuser +fo
INFO: adding +o implies adding the +l flag.
Global flags for testuser are now +flo.

删除用户:

.-user testuser
Deleted testuser.

⚠️ 注意区分:.+user 由全局 master 直接按句柄+掩码建用户;.adduser <nick> 是把当前正在频道里的昵称收编进用户库(人在频道里才能用,实测对不在频道的 testuser 执行返回 testuser is not on any channels I monitor)。

5.4 频道管理(.+chan / .-chan / .chaninfo / .channel)

动态加频道(立即加入并把设置写入 chanfile):

.+chan #eggdrop-fun
[05:12:09] #admin# +chan #eggdrop-fun

查看频道全部生效设置(36 项开关 + 洪水阈值,配置篇 5.9 的运行时形态):

.chaninfo #eggdrop-fun
Settings for dynamic channel #eggdrop-fun:
Protect modes (chanmode): +tn
Idle Kick after (idle-kick): DON'T!
ban-type: 3
ban-time: 120
Other modes:
     +greet          +cycle          +dontkickops    +protectops
     +dynamicbans    +userbans       ...
flood settings: chan ctcp join kick deop nick
number:           15    3    5    3    3    5
time  :           60   60   60   10   10   60

查看频道实时成员:

.channel #eggdrop-test
Channel #eggdrop-test, 1 member, mode +tn:
(n = owner, m = master, o = op, d = deop, b = bot)
 NICKNAME   HANDLE    ACCOUNT     JOIN   IDLE         USER@HOST
@eggtestbot *                    05:08                <- it's me!
End of channel info.

移除频道(连频道级封禁/邀请/用户记录一起清):

.-chan #eggdrop-fun
Channel #eggdrop-fun removed from the bot.
This includes any channel specific bans, invites, exemptions and user records that you set.

5.5 频道操作(.bans / .+ban / .-ban / .topic / .say / .act)

封禁与查看(.bans all 连全局封禁一起列):

.+ban *!*@baduser.example.com #eggdrop-test
New #eggdrop-test ban: *!*@baduser.example.com (requested)
.-ban *!*@baduser.example.com #eggdrop-test
Removed #eggdrop-test channel ban: *!*@baduser.example.com
.bans all
Global bans:   (! = not active on #eggdrop-test)
Channel bans for #eggdrop-test:   (! = not active, * = not placed by bot)
(There are no bans, permanent or otherwise.)

改主题、代发言、动作(/me):

.topic #eggdrop-test Eggdrop 1.10.2 test channel
[05:11:58] #admin# (#eggdrop-test) topic Eggdrop 1.10.2 test channel
Changing topic...
.say #eggdrop-test hello from partyline
Said to #eggdrop-test: hello from partyline
.act #eggdrop-test waves
Action to #eggdrop-test: waves

1.10 新增的 .+extban 支持扩展封禁(如 Libera.Chat 的 $a:账号 按账号封禁),用法同 .+ban。

5.6 服务器控制(.servers / .jump)

.servers
Server list:
  127.0.0.1:6667 (irc.example.com) <- I am here
End of server list.

.jump 立即断开并轮切到服务器列表的下一台:

.jump
Jumping servers......
[05:12:23] Trying server 127.0.0.1:6667
[05:12:23] Connected to 127.0.0.1

5.7 数据持久化与热加载(.save / .rehash)

.save 立即落盘用户库与频道文件(默认每小时自动执行一次,见配置篇 hourly-updates):

.save
Saving user file...
[05:10:51] Writing user file...
[05:10:51] Writing channel file...

.rehash 热加载配置文件(改完 conf 必做):

.rehash
Rehashing.
[05:14:24] Writing user file...
[05:14:24] Writing channel file...
[05:14:24] Rehashing ...
[05:14:24] Listening for telnet connections on 0.0.0.0 port 3333 (all).
[05:14:24] Loading dccwhois.tcl...
[05:14:24] Loaded dccwhois.tcl
[05:14:24] Userfile loaded, unpacking...

💡 对比记忆:.rehash 重读配置+重载脚本;.reload 仅重置频道状态;.restart 是软重启进程;.die 彻底退出(owner 专属,慎用)。

5.8 便签(.notes)

Eggdrop 内置用户间离线留言:

.notes read 1
 1. eggtestbot (Oct 25 05:06): Welcome to eggdrop! :)

相关命令:.notes(列表)、.notes read <编号>、.notes index、.note <句柄> <内容>(发送)。

5.9 调试与脚本(.tcl / .set)

.set 查询或修改运行时变量(不带值即查询):

.set must-be-owner
Currently: 1

.tcl 在机器人进程内直接执行 Tcl(永久 owner 专属):

.tcl expr {2+3}
Tcl: 5
.tcl putlog "tcl-works-on-partyline"
[05:14:30] tcl-works-on-partyline
Tcl:

⚠️ 权限实测:未在配置文件声明 set owner "admin" 时,telnet 注册的 owner 执行 .tcl 一律被拒,回显只有一句 What? You need '.help';声明并 .rehash 后立即可用。.set同理。这是set must-be-owner 1`(默认)的安全设计,不要为省事把它调成 0。

六、常用运维场景速查

场景命令序列
改了配置文件编辑 conf → .rehash → .status 验证
机器人没进频道.channels 类问题先 .chaninfo #频道 看 -inactive? → 必要时 .+chan #频道
加管理员.+user 句柄 *!*@掩码 → .chattr 句柄 +fo
紧急封人.+ban *!*@掩码 #频道(.bans all 复查)
换 IRC 服务器配置加 server add → .rehash → .jump → .servers 确认
看加载了哪些模块.modules
定期备份用户库.save(或等每小时自动);cp 备份 *.user/*.chan

七、常见问题

Q1:敲命令机器人装傻回 What? You need '.help'? 两种可能:命令不存在/拼错,或权限不足(机器人对无权限命令统一装傻)。先 .help all 对照命令树与你的权限组;.tcl/.set 类问题见 5.9。

Q2:登录 partyline 后说话别人都看得到? 是的。不带 . 的输入默认广播到 partyline 群聊,这是设计使然;私聊用 .note 或 IRC 私信。

Q3:-m 参数能反复用吗? 不能。它只在首次创建用户库时使用,用户库存在后正常使用 ./eggdrop 配置文件 或 systemd 托管。误用 -m 会让机器人重新等待 NEW 注册。

Q4:.rehash 改了端口监听但 ss 看不到变化? 绝大多数配置热生效,但个别结构性参数(如 max-logs 调小)需完整重启进程(.die 后由 systemd 拉起,或 .restart)。

Q5:怎么查某条命令的详细用法? .help <命令>,如 .help chanset、.help whois;.help *ban* 可模糊搜出所有与 ban 相关的帮助条目。

Q6:partyline 命令在脚本里能调用吗? 能,Tcl 脚本里用 dcc 系列绑定与 putcmdbounce 等接口;.help binds 可查看全部命令绑定表,二次开发从这里入手。

八、参考链接