MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / TeleBot

Class TeleBot

telebot/__init__.py:83–11005  ·  view source on GitHub ↗

This is the main synchronous class for Bot. It allows you to add handlers for different kind of updates. Usage: .. code-block:: python3 :caption: Creating instance of TeleBot from telebot import TeleBot bot = TeleBot('token') # get token from @BotFather

Source from the content-addressed store, hash-verified

81
82
83class TeleBot:
84 """
85 This is the main synchronous class for Bot.
86
87 It allows you to add handlers for different kind of updates.
88
89 Usage:
90
91 .. code-block:: python3
92 :caption: Creating instance of TeleBot
93
94 from telebot import TeleBot
95 bot = TeleBot('token') # get token from @BotFather
96 # now you can register other handlers/update listeners,
97 # and use bot methods.
98
99 See more examples in examples/ directory:
100 https://github.com/eternnoir/pyTelegramBotAPI/tree/master/examples
101
102 .. note::
103
104 Install coloredlogs module to specify colorful_logs=True
105
106
107 :param token: Token of a bot, should be obtained from @BotFather
108 :type token: :obj:`str`
109
110 :param parse_mode: Default parse mode, defaults to None
111 :type parse_mode: :obj:`str`, optional
112
113 :param threaded: Threaded or not, defaults to True
114 :type threaded: :obj:`bool`, optional
115
116 :param skip_pending: Skips pending updates, defaults to False
117 :type skip_pending: :obj:`bool`, optional
118
119 :param num_threads: Number of maximum parallel threads, defaults to 2
120 :type num_threads: :obj:`int`, optional
121
122 :param next_step_backend: Next step backend class, defaults to None
123 :type next_step_backend: :class:`telebot.handler_backends.HandlerBackend`, optional
124
125 :param reply_backend: Reply step handler class, defaults to None
126 :type reply_backend: :class:`telebot.handler_backends.HandlerBackend`, optional
127
128 :param exception_handler: Exception handler to handle errors, defaults to None
129 :type exception_handler: :class:`telebot.ExceptionHandler`, optional
130
131 :param last_update_id: Last update's id, defaults to 0
132 :type last_update_id: :obj:`int`, optional
133
134 :param suppress_middleware_excepions: Supress middleware exceptions, defaults to False
135 :type suppress_middleware_excepions: :obj:`bool`, optional
136
137 :param state_storage: Storage for states, defaults to StateMemoryStorage()
138 :type state_storage: :class:`telebot.storage.StateStorageBase`, optional
139
140 :param use_class_middlewares: Use class middlewares, defaults to False

Callers 14

mini_app.pyFile · 0.90
timer_bot.pyFile · 0.90
basic_example.pyFile · 0.90
main.pyFile · 0.90
main.pyFile · 0.90
main.pyFile · 0.90
webhookFunction · 0.90
add_botFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…