示例#1
0
 def __init__(
     self,
     api: Optional["ABCAPI"] = None,
     group_id: Optional[int] = None,
     wait: Optional[int] = None,
     rps_delay: Optional[int] = None,
     error_handler: Optional["ABCErrorHandler"] = None,
 ):
     self._api = api
     self.error_handler = error_handler or ErrorHandler()
     self.group_id = group_id
     self.wait = wait or 15
     self.rps_delay = rps_delay or 0
     self.stop = False
示例#2
0
 def __init__(
     self,
     url: Optional[str] = None,
     title: Optional[str] = None,
     secret_key: Optional[str] = None,
     api: Optional["ABCAPI"] = None,
     group_id: Optional[int] = None,
     error_handler: Optional["ABCErrorHandler"] = None,
 ):
     self.url = url
     self.title = title
     self.secret_key = secret_key or self._generate_secret_key()
     self._api = api
     self.group_id = group_id
     self.error_handler = error_handler or ErrorHandler()
示例#3
0
 def __init__(
     self,
     api: Optional["ABCAPI"] = None,
     user_id: Optional[int] = None,
     wait: Optional[int] = None,
     mode: Optional[int] = None,
     rps_delay: Optional[int] = None,
     error_handler: Optional["ABCErrorHandler"] = None,
 ):
     self._api = api
     self.error_handler = error_handler or ErrorHandler()
     self.user_id = user_id
     self.wait = wait or 15
     self.mode = mode or 234
     self.rps_delay = rps_delay or 0
     self.stop = False
示例#4
0
 def __init__(
     self,
     token: Optional[str] = None,
     api: Optional[ABCAPI] = None,
     polling: Optional[ABCPolling] = None,
     loop: Optional[AbstractEventLoop] = None,
     loop_wrapper: Optional[LoopWrapper] = None,
     router: Optional["ABCRouter"] = None,
     labeler: Optional["ABCBotLabeler"] = None,
     error_handler: Optional["ABCErrorHandler"] = None,
 ):
     self.api: Union[ABCAPI, API] = API(
         token) if token is not None else api  # type: ignore
     self.error_handler = error_handler or ErrorHandler()
     self.loop_wrapper = loop_wrapper or LoopWrapper()
     self.labeler = labeler or BotLabeler()
     self.state_dispenser = BuiltinStateDispenser()
     self._polling = polling or BotPolling(self.api)
     self._router = router or BotRouter()
     self._loop = loop
示例#5
0
文件: user.py 项目: rmdlv/vkbottle
 def __init__(
     self,
     token: Optional["Token"] = None,
     api: Optional["ABCAPI"] = None,
     polling: Optional["ABCPolling"] = None,
     loop: Optional["AbstractEventLoop"] = None,
     loop_wrapper: Optional[LoopWrapper] = None,
     router: Optional["ABCRouter"] = None,
     labeler: Optional["ABCLabeler"] = None,
     state_dispenser: Optional["ABCStateDispenser"] = None,
     error_handler: Optional["ABCErrorHandler"] = None,
     task_each_event: bool = True,
 ):
     self.api: Union["ABCAPI", API] = API(token) if token is not None else api  # type: ignore
     self.error_handler = error_handler or ErrorHandler()
     self.loop_wrapper = loop_wrapper or LoopWrapper()
     self.labeler = labeler or UserLabeler()
     self.state_dispenser = state_dispenser or BuiltinStateDispenser()
     self._polling = polling or UserPolling(self.api)
     self._router = router or Router()
     self._loop = loop
     self.task_each_event = task_each_event