mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
commit
7b95874627
@ -744,35 +744,35 @@ class TeleBot:
|
|||||||
"""
|
"""
|
||||||
self._notify_command_handlers(self.edited_channel_post_handlers, edited_channel_post, 'edited_channel_post')
|
self._notify_command_handlers(self.edited_channel_post_handlers, edited_channel_post, 'edited_channel_post')
|
||||||
|
|
||||||
def process_new_inline_query(self, new_inline_querys):
|
def process_new_inline_query(self, new_inline_queries):
|
||||||
"""
|
"""
|
||||||
:meta private:
|
:meta private:
|
||||||
"""
|
"""
|
||||||
self._notify_command_handlers(self.inline_handlers, new_inline_querys, 'inline_query')
|
self._notify_command_handlers(self.inline_handlers, new_inline_queries, 'inline_query')
|
||||||
|
|
||||||
def process_new_chosen_inline_query(self, new_chosen_inline_querys):
|
def process_new_chosen_inline_query(self, new_chosen_inline_queries):
|
||||||
"""
|
"""
|
||||||
:meta private:
|
:meta private:
|
||||||
"""
|
"""
|
||||||
self._notify_command_handlers(self.chosen_inline_handlers, new_chosen_inline_querys, 'chosen_inline_query')
|
self._notify_command_handlers(self.chosen_inline_handlers, new_chosen_inline_queries, 'chosen_inline_query')
|
||||||
|
|
||||||
def process_new_callback_query(self, new_callback_querys):
|
def process_new_callback_query(self, new_callback_queries):
|
||||||
"""
|
"""
|
||||||
:meta private:
|
:meta private:
|
||||||
"""
|
"""
|
||||||
self._notify_command_handlers(self.callback_query_handlers, new_callback_querys, 'callback_query')
|
self._notify_command_handlers(self.callback_query_handlers, new_callback_queries, 'callback_query')
|
||||||
|
|
||||||
def process_new_shipping_query(self, new_shipping_querys):
|
def process_new_shipping_query(self, new_shipping_queries):
|
||||||
"""
|
"""
|
||||||
:meta private:
|
:meta private:
|
||||||
"""
|
"""
|
||||||
self._notify_command_handlers(self.shipping_query_handlers, new_shipping_querys, 'shipping_query')
|
self._notify_command_handlers(self.shipping_query_handlers, new_shipping_queries, 'shipping_query')
|
||||||
|
|
||||||
def process_new_pre_checkout_query(self, pre_checkout_querys):
|
def process_new_pre_checkout_query(self, pre_checkout_queries):
|
||||||
"""
|
"""
|
||||||
:meta private:
|
:meta private:
|
||||||
"""
|
"""
|
||||||
self._notify_command_handlers(self.pre_checkout_query_handlers, pre_checkout_querys, 'pre_checkout_query')
|
self._notify_command_handlers(self.pre_checkout_query_handlers, pre_checkout_queries, 'pre_checkout_query')
|
||||||
|
|
||||||
def process_new_poll(self, polls):
|
def process_new_poll(self, polls):
|
||||||
"""
|
"""
|
||||||
@ -1087,12 +1087,10 @@ class TeleBot:
|
|||||||
|
|
||||||
|
|
||||||
def _exec_task(self, task, *args, **kwargs):
|
def _exec_task(self, task, *args, **kwargs):
|
||||||
if kwargs and kwargs.get('task_type') == 'handler':
|
if kwargs:
|
||||||
pass_bot = kwargs.get('pass_bot')
|
if kwargs.pop('task_type', "") == 'handler':
|
||||||
kwargs.pop('pass_bot')
|
if kwargs.pop('pass_bot', False):
|
||||||
kwargs.pop('task_type')
|
kwargs['bot'] = self
|
||||||
if pass_bot:
|
|
||||||
kwargs['bot'] = self
|
|
||||||
|
|
||||||
if self.threaded:
|
if self.threaded:
|
||||||
self.worker_pool.put(task, *args, **kwargs)
|
self.worker_pool.put(task, *args, **kwargs)
|
||||||
@ -5977,16 +5975,16 @@ class TeleBot:
|
|||||||
:param new_messages:
|
:param new_messages:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
if len(handlers) == 0 and not self.use_class_middlewares:
|
if not(handlers) and not(self.use_class_middlewares):
|
||||||
return
|
return
|
||||||
|
|
||||||
for message in new_messages:
|
for message in new_messages:
|
||||||
if self.use_class_middlewares:
|
if not self.use_class_middlewares:
|
||||||
middleware = self._check_middleware(update_type)
|
|
||||||
self._exec_task(self._run_middlewares_and_handler, message, handlers=handlers, middlewares=middleware, update_type=update_type)
|
|
||||||
return
|
|
||||||
else:
|
|
||||||
for message_handler in handlers:
|
for message_handler in handlers:
|
||||||
if self._test_message_handler(message_handler, message):
|
if self._test_message_handler(message_handler, message):
|
||||||
self._exec_task(message_handler['function'], message, pass_bot=message_handler['pass_bot'], task_type='handler')
|
self._exec_task(message_handler['function'], message, pass_bot=message_handler['pass_bot'], task_type='handler')
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
middleware = self._check_middleware(update_type)
|
||||||
|
self._exec_task(self._run_middlewares_and_handler, message, handlers=handlers, middlewares=middleware, update_type=update_type)
|
||||||
|
return
|
||||||
|
@ -563,35 +563,35 @@ class AsyncTeleBot:
|
|||||||
"""
|
"""
|
||||||
await self._process_updates(self.edited_channel_post_handlers, edited_channel_post, 'edited_channel_post')
|
await self._process_updates(self.edited_channel_post_handlers, edited_channel_post, 'edited_channel_post')
|
||||||
|
|
||||||
async def process_new_inline_query(self, new_inline_querys):
|
async def process_new_inline_query(self, new_inline_queries):
|
||||||
"""
|
"""
|
||||||
:meta private:
|
:meta private:
|
||||||
"""
|
"""
|
||||||
await self._process_updates(self.inline_handlers, new_inline_querys, 'inline_query')
|
await self._process_updates(self.inline_handlers, new_inline_queries, 'inline_query')
|
||||||
|
|
||||||
async def process_new_chosen_inline_query(self, new_chosen_inline_querys):
|
async def process_new_chosen_inline_query(self, new_chosen_inline_queries):
|
||||||
"""
|
"""
|
||||||
:meta private:
|
:meta private:
|
||||||
"""
|
"""
|
||||||
await self._process_updates(self.chosen_inline_handlers, new_chosen_inline_querys, 'chosen_inline_query')
|
await self._process_updates(self.chosen_inline_handlers, new_chosen_inline_queries, 'chosen_inline_query')
|
||||||
|
|
||||||
async def process_new_callback_query(self, new_callback_querys):
|
async def process_new_callback_query(self, new_callback_queries):
|
||||||
"""
|
"""
|
||||||
:meta private:
|
:meta private:
|
||||||
"""
|
"""
|
||||||
await self._process_updates(self.callback_query_handlers, new_callback_querys, 'callback_query')
|
await self._process_updates(self.callback_query_handlers, new_callback_queries, 'callback_query')
|
||||||
|
|
||||||
async def process_new_shipping_query(self, new_shipping_querys):
|
async def process_new_shipping_query(self, new_shipping_queries):
|
||||||
"""
|
"""
|
||||||
:meta private:
|
:meta private:
|
||||||
"""
|
"""
|
||||||
await self._process_updates(self.shipping_query_handlers, new_shipping_querys, 'shipping_query')
|
await self._process_updates(self.shipping_query_handlers, new_shipping_queries, 'shipping_query')
|
||||||
|
|
||||||
async def process_new_pre_checkout_query(self, pre_checkout_querys):
|
async def process_new_pre_checkout_query(self, pre_checkout_queries):
|
||||||
"""
|
"""
|
||||||
:meta private:
|
:meta private:
|
||||||
"""
|
"""
|
||||||
await self._process_updates(self.pre_checkout_query_handlers, pre_checkout_querys, 'pre_checkout_query')
|
await self._process_updates(self.pre_checkout_query_handlers, pre_checkout_queries, 'pre_checkout_query')
|
||||||
|
|
||||||
async def process_new_poll(self, polls):
|
async def process_new_poll(self, polls):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user