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