def __init__(self, host, **kwargs):
        '''
        Initializes a new pyrc.Bot.
        '''
        nick = "PyrcBot" if self.__class__ == Bot else self.__class__.__name__
        password = os.environ.get('PASSWORD', None)

        self.config = dict(kwargs)
        self.config.setdefault('host', host)
        self.config.setdefault('port', 6667)
        self.config.setdefault('nick', nick)
        self.config.setdefault('names', [self.config['nick']])
        self.config.setdefault('ident', nick.lower())
        self.config.setdefault('realname', "A Pyrc Bot")
        self.config.setdefault('channels', [])
        self.config.setdefault('password', password)
        self.config.setdefault('break_on_match', True)
        self.config.setdefault('verbose', True)
        self.config.setdefault('prefix', '%')

        self._inbuffer = ""
        self._commands = []
        self._privmsgs = []
        self._threads = []
        self.socket = None
        self.initialized = False
        self.listeners = {}

        # init funcs
        self._add_listeners()
        self._addhooks()
def __init__ ( self , host , ** kwargs ) : nick = "PyrcBot" if self . __class__ == Bot else self . __class__ . __name__ password = os . environ . get ( 'PASSWORD' , None ) self . config = dict ( kwargs ) self . config . setdefault ( 'host' , host ) self . config . setdefault ( 'port' , 6667 ) self . config . setdefault ( 'nick' , nick ) self . config . setdefault ( 'names' , [ self . config [ 'nick' ] ] ) self . config . setdefault ( 'ident' , nick . lower ( ) ) self . config . setdefault ( 'realname' , "A Pyrc Bot" ) self . config . setdefault ( 'channels' , [ ] ) self . config . setdefault ( 'password' , password ) self . config . setdefault ( 'break_on_match' , True ) self . config . setdefault ( 'verbose' , True ) self . config . setdefault ( 'prefix' , '%' ) self . _inbuffer = "" self . _commands = [ ] self . _privmsgs = [ ] self . _threads = [ ] self . socket = None self . initialized = False self . listeners = { } self . _add_listeners ( ) self . _addhooks ( )
Initializes a new pyrc.Bot.