Get data for current user. .. code-block:: python3 with state_context.data() as data: print(data) data['name'] = 'John'
(self)
| 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 | """ |
nothing calls this directly
no test coverage detected