Example #1
0
 def __init__(self, config_file, ssl=False, plugin_config = {}):
     """ Initializes the bot
             config_file -- string pointing to an xml configuration file
     """
     self.config_file = config_file
     self.botconfig = self.load_config(config_file)
     auth = self.botconfig.find('auth')
     logging.info("Logging in as %s" % auth.attrib['jid'])
     sleekxmpp.ClientXMPP.__init__(self, auth.attrib['jid'], auth.attrib['pass'], auth.get('ssl', True), plugin_config)
     storageXml = self.botconfig.find('storage')
     if storageXml is not None:
         self.store = store(storageXml.attrib['file'])
     else:
         logging.warning("No storage element found in config file - proceeding with no persistent storage, plugin behaviour may be undefined.")
     self.rooms = {}
     self.add_event_handler("session_start", self.handle_session_start, threaded=True)
     self.register_xmpp_plugins()
     CommandBot.__init__(self)
     PlugBot.__init__(self, default_package = 'sleekbot.plugins')
     self.register_adhocs()