(self, nick, connections, *args, **kwargs)
acts as a connection manager, middle man for incoming events, and processor of outgoing actions.
acts as a connection manager, middle man for incoming events, and processor of outgoing actions.
acts as a connection manager middle man for incoming events and processor of outgoing actions .
def __init__(self, nick, connections, *args, **kwargs):
        """
        acts as a connection manager, middle man for incoming events, and processor of outgoing actions.
        """
        #TODO: maybe support a custom internal key to keep track of bots, not just by 'name'...
        #TODO: if we do it by name, make sure we don't have name dupes, even between networks :-/

        # bot id
        self.nick = nick
        self.id = str(uuid.uuid1())
        self.log = logging.getLogger('{0}.{1}.{2}'.format(self.__class__.__module__, self.__class__.__name__,
                                                          self.nick))
        self.log.info('starting bot')

        #bot manager instance
        self.bot_manager = None

        # setup this bots event queue / consumer, action queue/consumer
        self.event_queue = defer.DeferredQueue()
        self._consume_events(self.event_queue)

        self.action_queue = defer.DeferredQueue()
        self._consume_actions(self.action_queue)

        # setup plugins
        self.enabled_plugins = kwargs.get('enabled_plugins')
        self.plugin_manager = PluginManager(bot=self)
        # self.manager.config.PLUGINS:

        # build connections
        # TODO: create connection manager
        self.connection_manager = ConnectionManager(config=connections, bot=self)
        self.log.debug('connections on {0!r}: {1!r}'.format(self.nick, self.connection_manager))

        # should have a 'ready' state that we should check before starting?
        self.state = OFF
        self.party_line = None
def __init__ ( self , nick , connections , * args , * * kwargs ) : #TODO: maybe support a custom internal key to keep track of bots, not just by 'name'... #TODO: if we do it by name, make sure we don't have name dupes, even between networks :-/ # bot id self . nick = nick self . id = str ( uuid . uuid1 ( ) ) self . log = logging . getLogger ( '{0}.{1}.{2}' . format ( self . __class__ . __module__ , self . __class__ . __name__ , self . nick ) ) self . log . info ( 'starting bot' ) #bot manager instance self . bot_manager = None # setup this bots event queue / consumer, action queue/consumer self . event_queue = defer . DeferredQueue ( ) self . _consume_events ( self . event_queue ) self . action_queue = defer . DeferredQueue ( ) self . _consume_actions ( self . action_queue ) # setup plugins self . enabled_plugins = kwargs . get ( 'enabled_plugins' ) self . plugin_manager = PluginManager ( bot = self ) # self.manager.config.PLUGINS: # build connections # TODO: create connection manager self . connection_manager = ConnectionManager ( config = connections , bot = self ) self . log . debug ( 'connections on {0!r}: {1!r}' . format ( self . nick , self . connection_manager ) ) # should have a 'ready' state that we should check before starting? self . state = OFF self . party_line = None