1
我已经在Python中完成了一个IRC-Bot。 我想创建一个关机命令。 它看起来像这样:从套接字上的客户端关闭和关闭的Python Irc-Bot EOF
self.SendMessage("Bye!", self.connectedchannel) # Send bye to the connected channel
self.connection.shutdown(socket.SHUT_RDWR) # Shutdown the socket
self.connection.close() # Close the socket
sys.exit() # Exit the program
但在IRC与“从客户EOF”机器人断开,它不正确断开。 如何更改我的代码呢?
您必须发送QUIT信息,然后关闭连接。 (不是'PRIVMSG',我的意思是'QUIT:Bye!') –
谢谢,这个工作!你能补充一点吗? – Thor77