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

Method __init__

telebot/async_telebot.py:128–206  ·  view source on GitHub ↗
(self, token: str, parse_mode: Optional[str]=None, offset: Optional[int]=None,
                exception_handler: Optional[ExceptionHandler]=None,
                state_storage: Optional[StateStorageBase]=StateMemoryStorage(),
                disable_web_page_preview: Optional[bool]=None,
                disable_notification: Optional[bool]=None,
                protect_content: Optional[bool]=None,
                allow_sending_without_reply: Optional[bool]=None,
                colorful_logs: Optional[bool]=False,
                validate_token: Optional[bool]=True)

Source from the content-addressed store, hash-verified

126 """
127
128 def __init__(self, token: str, parse_mode: Optional[str]=None, offset: Optional[int]=None,
129 exception_handler: Optional[ExceptionHandler]=None,
130 state_storage: Optional[StateStorageBase]=StateMemoryStorage(),
131 disable_web_page_preview: Optional[bool]=None,
132 disable_notification: Optional[bool]=None,
133 protect_content: Optional[bool]=None,
134 allow_sending_without_reply: Optional[bool]=None,
135 colorful_logs: Optional[bool]=False,
136 validate_token: Optional[bool]=True) -> None:
137
138 # update-related
139 self.token = token
140 self.offset = offset
141
142 # logs-related
143 if colorful_logs:
144 try:
145 import coloredlogs
146 coloredlogs.install(logger=logger, level=logger.level)
147 except ImportError:
148 raise ImportError(
149 'Install coloredlogs module to use colorful_logs option.'
150 )
151
152 # properties
153 self.parse_mode = parse_mode
154 self.disable_web_page_preview = disable_web_page_preview
155 self.disable_notification = disable_notification
156 self.protect_content = protect_content
157 self.allow_sending_without_reply = allow_sending_without_reply
158
159 # states
160 self.current_states = state_storage
161
162 # handlers
163 self.update_listener = []
164 self.exception_handler = exception_handler
165 self.message_handlers = []
166 self.edited_message_handlers = []
167 self.channel_post_handlers = []
168 self.edited_channel_post_handlers = []
169 self.message_reaction_handlers = []
170 self.message_reaction_count_handlers = []
171 self.inline_handlers = []
172 self.chosen_inline_handlers = []
173 self.callback_query_handlers = []
174 self.shipping_query_handlers = []
175 self.pre_checkout_query_handlers = []
176 self.poll_handlers = []
177 self.poll_answer_handlers = []
178 self.my_chat_member_handlers = []
179 self.chat_member_handlers = []
180 self.chat_join_request_handlers = []
181 self.removed_chat_boost_handlers = []
182 self.chat_boost_handlers = []
183 self.business_connection_handlers = []
184 self.business_message_handlers = []
185 self.edited_business_message_handlers = []

Callers

nothing calls this directly

Calls 1

StateMemoryStorageClass · 0.90

Tested by

no test coverage detected