Writing:
vk.method("messages.getConversations", {"offset": 0, "count": 20, "filter": "unanswered"})
I get the answer from VK the following answer:
{'count': 1, 'items': [{'conversation': {'peer': {'id': 242369682, 'type': 'user', 'local_id': HereNumber ID}, 'in_read': 185, 'out_read': 186, 'last_message_id': 186, 'unread_count': 1, 'unanswered': True, 'can_write': {'allowed': True}}, 'last_message': {'date': 1556627567, 'from_id ': HereNumber ID,' id ': 186,' out ': 0,' peer_id ': HereNumber ID,' text ':' donate ',' conversation_message_id ': 176,' fwd_messages ': [],' important ': False,' random_id ': 0,' attachments': [], 'is_hidden': False}}], 'unread_count': 1}
How do I get the values from there? Same ID for example. I mean not specifically the ID value through the VKontakte API, but in general the method of obtaining the value from such an array. Those. if it were a simple array, it would be clear that there you could write an array [numberArgument]. Immediately somehow more complicated.
print(type(vk.method("messages.getConversations", {"offset": 0, "count": 20, "filter": "unanswered"})))
? I think you will havedict
orstr
. Most likely,dict
. From your answer you can continue to dance :) - gil9red pm