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

Class StateMiddleware

telebot/states/sync/middleware.py:8–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class StateMiddleware(BaseMiddleware):
9
10 def __init__(self, bot: TeleBot) -> None:
11 self.update_sensitive = False
12 self.update_types = update_types
13 self.bot: TeleBot = bot
14
15 def pre_process(self, message, data):
16 state_context = StateContext(message, self.bot)
17 data['state_context'] = state_context
18 data['state'] = state_context # 2 ways to access state context
19
20 def post_process(self, message, data, exception):
21 pass

Callers 2

custom_states.pyFile · 0.90
custom_states.pyFile · 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…