Python IRC机器人 Quakenet无Ident响应
我在把我的Python IRC机器人连接到Quakenet时遇到了一些问题。
其他网络(比如freenode或euirc)都能正常工作。
这是我使用的irc库的代码:https://github.com/Thor77/PythonIrcBot/blob/master/irc.py
我的机器人的输出信息如下:
b'>>PASS somepassword'
b'>>NICK Thor2'
b'>>USER Thor2 Thor2 Thor2 :Thor2'
b'<<NOTICE AUTH :*** Looking up your hostname\r\n'
b'<<NOTICE AUTH :*** Checking Ident\r\nNOTICE AUTH :*** No ident response\r\nPING :3048259664\r\nNOTICE AUTH :*** Found your hostname\r\n'
b'<<:protectglobal.uk.quakenet.org 513 Thor2 :Your client may not be compatible with this server.\r\n:protectglobal.uk.quakenet.org 513 Thor2 :Compatible clients are available at ftp://ftp.undernet.org/pub/irc/clients\r\nERROR :Closing Link: Thor2 by protectglobal.uk.quakenet.org (Registration Timeout)\r\n'
1 个回答
1
解决办法是,我需要在收到NICK消息后,回应一个PING。
self._send('PASS somepassword')
self._send('NICK ' + nick)
self._read() # reads messages from server, find ping, send pong
self._send('USER %s %s %s :%s %s' % (nick, nick, nick, nick, nick[::-1]))