def main(): (options, args) = PurpleParser().parse_args() logging.root.setLevel(options.verbose) pb = bot(1, options.settings) for plugin in pb.settings.get('Plugins', []): pb.plugin_register(plugin) pb.run( options.host, options.port, options.nick, options.ident, options.realname )
irc.setLevel(logging.NOTSET) irc.setFormatter( logging.Formatter('%(message)s') ) logging.getLogger('irc.in').addHandler(irc) logging.getLogger('irc.out').addHandler(irc) HOST="irc.gamesurge.net" PORT=6667 NICK="PurpleBot" IDENT="PurpleBot" REALNAME="PurpleBot" QUITMSG = "Sayonara" CHANNELS=["#bottesting"] #Setup the bot with debugging sample = bot(2) #Load plugins sample.plugin_register('purplebot.plugins.admin') sample.plugin_register('purplebot.plugins.voice') #Add command aliases sample.alias_add('$ignore','$addblock') #Settings sample.settings.set('Setting::key','Setting Value') #Have functions fire after a certain delay def join(bot,channels): for channel in channels: bot.irc_join(channel)