是否有办法来自动周期性任务:像发送消息给其他用户或通道等使用python irclib或基于双绞线youmomdotcom蟒蛇IRC bot的 。
基于irclib IRC客户端的实施例:
from irc import client
class OurIRCClient(client.SimpleIRCClient):
def __init__(self):
client.SimpleIRCClient.__init__(self)
import sys
client = OurIRCClient()
try:
client.connect("irc.freenode.net", 6667, myUserId)
print "connected to irc.freenode.net"
except:
sys.exit(-1)
"error: coouldn't connect to irc server"
client.connection.join("#django-hotclub")
client.start()