确定用户是否在 IRC 上被识别
在我的 IRC 机器人中,有一些命令我希望只能由我自己使用,并且我想检查以确保使用我的名字的任何人都通过 nickserv(已识别)进行标识。然而,我无法找到一种简单的方法来确定这一点,这就是我来这里的原因。
Freenode 和 Rizon< /a> 是主要目标网络(如果重要的话)。
编辑:我实际上知道已识别用户的各种用户模式(尽管我没有给予足够的关注来意识到它们的不同!);抱歉之前没有提到这一点。然而,我从用户那里得到的原始响应不包括他们的用户模式;它看起来像这样:
:[email protected] PRIVMSG #erasmus-testing :foo
那么,我想我正在尝试找到一种方法(使用各种 ircd,grr)来获取这些标志。如果,正如有人提到的,Rizon 返回某人是否在 WHOIS 查询中被识别,那么这就是我正在寻找的东西。
In my IRC Bot, there are some commands that I want to only be usable by me, and I want to check to make sure that anyone using my name is identified with nickserv (idented). I couldn't, however, find an easy way to determine this, which is why I'm here.
Freenode and Rizon are the primary target networks, if that matters.
Edit: I was actually aware of the various usermodes for idented users (although I didn't pay enough attention to realize that they differ!); sorry for not mentioning that before. The raw response that I get from a user, however, doesn't include their usermodes; it looks something like this:
:[email protected] PRIVMSG #erasmus-testing :foo
I suppose, then, that I'm trying to find a way (with various ircds, grr) to get those flags. If, as someone mentioned, Rizon returns whether or not someone is idented in a WHOIS query, then that's the sort of thing I'm looking for.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
在 freenode 上,向 nickserv 发送带有消息
ACC
的私人消息将返回一个指示用户身份状态的数字:STATUS
命令在 Rizon 上给出类似的结果:与 WHOIS 相比,此方法的优点是:
On freenode, sending a private message to nickserv with the message
ACC <nickname>
will return a number that indicates the user's ident status:The
STATUS <nickname>
command gives similar results on Rizon:The advantages that this method has over a WHOIS:
在某些网络上,您可以启用名为“identify-msg”的功能。在 FreeNode 上,您可以通过在首次连接到服务器时发送“CAP REQ recognize-msg”和“CAP END”来完成此操作。服务器将回复确认该功能的回复。此后,所有消息(和 CTCP ACTION)将在前面加上“+”(用户已识别 NickServ)或“-”(用户未识别 NickServ),例如:
:[e邮件受保护] PRIVMSG #erasmus-testing :+foo
On some networks you can enable a feature called 'identify-msg'. On FreeNode you do it by sending "CAP REQ identify-msg" and "CAP END" when you first connect to the server. The server will respond with a reply confirming that feature. Afterwards, all messages (and CTCP ACTIONs) will be preceded with a "+" (user has identified with NickServ) or a "-" (user has not identified with NickServ), e.g.:
:[email protected] PRIVMSG #erasmus-testing :+foo
昵称注册不是 IRC 标准的一部分。它始终由定制的 IRC 服务器和/或机器人提供。我认为您不会找到真正通用的解决方案,但 NickServ 是一种通用的可用实现,可以在许多网络上运行。维基百科有更多信息。
您可能想完全回避这个问题,并让您的用户使用您的机器人注册,而不是使用 nickserv。然后,您的机器人将进行密码检查,并在用户注销时使用户的凭据无效。这将是一个通用的解决方案。
Nick registration is not part of the IRC standard. It is always offered by customized IRC servers and/or bots. I don't think you're going to find a truly universal solution, but NickServ is a common available implementation, which would work on many networks. Wikipedia has more info.
You may want to sidestep the problem entirely and have your user register with your bot, instead of with nickserv. Your bot would then do the password checking, and would invalidate the user's credentials when the user logs out. This would be a universal solution.
当您的用户名已注册时,在您的机器人登录之前,您执行以下命令:
此命令将删除登录到您的用户的任何用户,请记住,我只在 Freenode 中使用了此命令,我不知道它是否会在 Freenode 上运行另一台服务器。
As your username is registered, before your bot logs in, you do this command:
This command will remove any user that is logged in on your user, remember that I only used this in Freenode, I don't know if it will function on another server.
对于 Freenode,如果用户被 NickServ 识别,那么他们的用户就具有 +e 模式设置。不确定 Rizon 是否有类似的东西。
With Freenode, if a user is identified to NickServ then their user has the +e mode set. Not sure if Rizon has something similar.
UnrealIRCd 和 hybrd 将 +r 设置为注册用户,我不确定是否所有 IRC 服务器都这样做,它非常不标准化。另外,在 Rizon 上,您可以进行 whois,它会告诉您用户是否已注册。
UnrealIRCd and hybrd set +r to registered users, I'm not sure if all IRC servers do this though, it's pretty unstandardized. Also on Rizon you can whois and it will tell you if the user is registered.
/NickServ INFO
这将告诉您用户是否已注册。
我通过以下网站发现了该命令: http://www.deepspace.org/nickserv.htm
/NickServ INFO <username>
This will tell you whether the user is registered or not.
I discovered the command via this site: http://www.deepspace.org/nickserv.htm