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

Method _notify_command_handlers

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

Notifies command handlers. :param handlers: all created handlers :param new_messages: received messages to proceed :param update_type: handler/update type (Update fields) :return:

(self, handlers, new_messages, update_type)

Source from the content-addressed store, hash-verified

10981
10982
10983 def _notify_command_handlers(self, handlers, new_messages, update_type):
10984 """
10985 Notifies command handlers.
10986
10987 :param handlers: all created handlers
10988 :param new_messages: received messages to proceed
10989 :param update_type: handler/update type (Update fields)
10990 :return:
10991 """
10992 if (not handlers) and (not self.use_class_middlewares):
10993 return
10994
10995 if self.use_class_middlewares:
10996 middlewares = self._get_middlewares(update_type)
10997 else:
10998 middlewares = None
10999 for message in new_messages:
11000 self._exec_task(
11001 self._run_middlewares_and_handler,
11002 message,
11003 handlers=handlers,
11004 middlewares=middlewares,
11005 update_type=update_type)

Calls 2

_get_middlewaresMethod · 0.95
_exec_taskMethod · 0.95

Tested by

no test coverage detected