Source code for point.plugs.irc
# p/plugs/irc.py
#
#
""" start various ps. """
# thnx to nikt none
## IMPORTS
from point import kernel, Object, NoSuchBotType, XMPPBot, IRCBot, ConsoleBot, Bot
from point.utils import error, run_thr
## basic imports
import logging
import _thread
import time
## default config
cfg = Object()
cfg.server = "localhost"
cfg.username = "point"
cfg.channel = "#point"
cfg.nick = "point"
cfg.start = "irc"
[docs]def start_irc(cfg):
logging.warn("using cfg %s" % cfg)
bot = IRCBot(cfg)
run_thr(bot.begin, ())
[docs]def init():
new_cfg = kernel.last("start", "irc")
if not new_cfg: new_cfg = cfg ; new_cfg.save()
start_irc(new_cfg)