python irc bot ping answer

I'm trying to write a simple IRC bot in Python. My bot would connect to a server, join a channel and then print to the console the messages received by the bot. I did it, but the server always disconnects me after a while because of ping timeout. I tried to use some libraries (python-irc and oyoyo) and they both ALLEGEDLY handle automatically the ping-pong messages with the server. But I tried with irc.abjects.net and irc.criten.net and with both of them these libraries failed. Then I made a script based on this one: http://hawkee.com/snippet/9725/. And it failed too. So... I suppose the problem is very stupid and simple, but I jsut can't figure out a solution.

Note: with the library irc3 the ping-pong works fine, but it uses asyncio, which conflicts with some other parts of my code (not related to irc). So I can't use it.

链接地址: http://www.djcxy.com/p/53470.html

上一篇: 如何遍历列表中的最后一项而不是所有项目?

下一篇: python irc bot ping的答案