MCPcopy Index your code
hub / github.com/eternnoir/pyTelegramBotAPI / AsyncTeleBot

Class AsyncTeleBot

telebot/async_telebot.py:66–10158  ·  view source on GitHub ↗

This is the main asynchronous class for Bot. It allows you to add handlers for different kind of updates. Usage: .. code-block:: python3 :caption: Using asynchronous implementation of TeleBot. from telebot.async_telebot import AsyncTeleBot bot = AsyncTele

Source from the content-addressed store, hash-verified

64
65
66class AsyncTeleBot:
67 """
68 This is the main asynchronous class for Bot.
69
70 It allows you to add handlers for different kind of updates.
71
72 Usage:
73
74 .. code-block:: python3
75 :caption: Using asynchronous implementation of TeleBot.
76
77 from telebot.async_telebot import AsyncTeleBot
78 bot = AsyncTeleBot('token') # get token from @BotFather
79 # now you can register other handlers/update listeners,
80 # and use bot methods.
81 # Remember to use async/await keywords when necessary.
82
83 See more examples in examples/ directory:
84 https://github.com/eternnoir/pyTelegramBotAPI/tree/master/examples
85
86 .. note::
87
88 Install coloredlogs module to specify colorful_logs=True
89
90
91 :param token: Token of a bot, obtained from @BotFather
92 :type token: :obj:`str`
93
94 :param parse_mode: Default parse mode, defaults to None
95 :type parse_mode: :obj:`str`, optional
96
97 :param offset: Offset used in get_updates, defaults to None
98 :type offset: :obj:`int`, optional
99
100 :param exception_handler: Exception handler, which will handle the exception occured, defaults to None
101 :type exception_handler: Optional[ExceptionHandler], optional
102
103 :param state_storage: Storage for states, defaults to StateMemoryStorage()
104 :type state_storage: :class:`telebot.asyncio_storage.StateMemoryStorage`, optional
105
106 :param disable_web_page_preview: Default value for disable_web_page_preview, defaults to None
107 :type disable_web_page_preview: :obj:`bool`, optional
108
109 :param disable_notification: Default value for disable_notification, defaults to None
110 :type disable_notification: :obj:`bool`, optional
111
112 :param protect_content: Default value for protect_content, defaults to None
113 :type protect_content: :obj:`bool`, optional
114
115 :param allow_sending_without_reply: Deprecated - Use reply_parameters instead. Default value for allow_sending_without_reply, defaults to None
116 :type allow_sending_without_reply: :obj:`bool`, optional
117
118 :param colorful_logs: Outputs colorful logs
119 :type colorful_logs: :obj:`bool`, optional
120
121 :param validate_token: Validate token, defaults to True;
122 :type validate_token: :obj:`bool`, optional
123

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…