def init(): bot = IRC() bot.connect(config.hostname, config.port, config.nickname, config.username, config.realname, config.channel, use_ssl=config.ssl, use_proxy=config.proxy, proxy_host=config.proxy_host, proxy_port=config.proxy_port) driver = pluginDriver() driver.load_plugins("plugins") return bot, driver
#!/usr/bin/python # coding: utf-8 import os import sys import traceback sys.path += ("irc", ) from pluginDriver import pluginDriver from irc import IRC from auth import auth bot = IRC("irc.freenode.net", 6697, "phukbot", "phukj00", "phuk3r", use_ssl=1) bot.raw("MODE phukbot +B") bot.join("#nopezor") driver = pluginDriver() driver.load_plugins("plugins", bot) authentication = auth(bot) authentication.auth_levels['phukd'] = 10 while bot.connected == 1: buffer = bot.receive() if not buffer: continue for buf in buffer: if not buf: continue (tmp, auth_level) = authentication.check(bot, buf)