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

Method data

telebot/states/sync/context.py:106–124  ·  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

104 )
105
106 def data(self) -> dict:
107 """
108 Get data for current user.
109
110 .. code-block:: python3
111
112 with state_context.data() as data:
113 print(data)
114 data['name'] = 'John'
115 """
116
117 chat_id, user_id, business_connection_id, bot_id, message_thread_id = resolve_context(self.message, self.bot.bot_id)
118 return self.bot.retrieve_data(
119 chat_id=chat_id,
120 user_id=user_id,
121 business_connection_id=business_connection_id,
122 bot_id=bot_id,
123 message_thread_id=message_thread_id
124 )
125
126 def add_data(self, **kwargs) -> None:
127 """

Callers 2

finishFunction · 0.45
finishFunction · 0.45

Calls 2

resolve_contextFunction · 0.90
retrieve_dataMethod · 0.45

Tested by

no test coverage detected