166.6. 获取频道用户列表
使用 nameOnJoin
选项,可在组件加入频道后调用 IRC-NAMES
命令。服务器将使用 irc.num = 353
回复。为了处理结果,onReply
的结果必须是 true
。此外,必须过滤 onReply
Exchanges 才能获取名称。
例如,我们希望获取包含频道用户名的所有交换:
from("ircs:nick@myserver:1234/#mychannelname?namesOnJoin=true&onReply=true") .choice() .when(header("irc.messageType").isEqualToIgnoreCase("REPLY")) .filter(header("irc.num").isEqualTo("353")) .to("mock:result").stop();
from("ircs:nick@myserver:1234/#mychannelname?namesOnJoin=true&onReply=true")
.choice()
.when(header("irc.messageType").isEqualToIgnoreCase("REPLY"))
.filter(header("irc.num").isEqualTo("353"))
.to("mock:result").stop();