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

Method data

telebot/states/asyncio/context.py:113–133  ·  view source on GitHub ↗

Get data for current user. .. code-block:: python3 with state_context.data() as data: print(data) data['name'] = 'John'

(self)

Source from the content-addressed store, hash-verified

111 )
112
113 def data(self) -> dict:
114 """
115 Get data for current user.
116
117 .. code-block:: python3
118
119 with state_context.data() as data:
120 print(data)
121 data['name'] = 'John'
122 """
123
124 chat_id, user_id, business_connection_id, bot_id, message_thread_id = (
125 resolve_context(self.message, self.bot.bot_id)
126 )
127 return self.bot.retrieve_data(
128 chat_id=chat_id,
129 user_id=user_id,
130 business_connection_id=business_connection_id,
131 bot_id=bot_id,
132 message_thread_id=message_thread_id,
133 )
134
135 async def add_data(self, **kwargs) -> None:
136 """

Callers

nothing calls this directly

Calls 2

resolve_contextFunction · 0.90
retrieve_dataMethod · 0.45

Tested by

no test coverage detected