我将Python IRC-Bot连接到Quakenet时遇到了一些问题
其他网络(如freenode或euirc)工作正常
我的irc-lib代码: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'
答案 0 :(得分:1)
解决方案是, 我需要回应PING, 在NICK-Message之后。
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]))