我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用handler.Handler()。
def __init__(self, url, port=None, ip=None, auto_shutdown=True, wait_time=20, timeout=5, is_playing_fnc=None): self.port = port if port else random.randint(8000,8099) self.ip = ip if ip else "127.0.0.1" self.connected = False self.start_time = None self.last_connect = None self.is_playing_fnc = is_playing_fnc self.auto_shutdown = auto_shutdown self.wait_time = wait_time self.timeout = timeout self.running = False self.file = None self.files = [] self._server = Server((self.ip, self.port), Handler, client=self) self.add_url(url) self.start()
def __init__(self, *args, **kwargs): super(TeleBot, self).__init__(*args, **kwargs) # Init super class first to get sender mixin self.status = status.bot_status self.handler = Handler(self.status.tuling_token, self.status.admin) self.replier = Replier(self.sender)