Answer the question
In order to leave comments, you need to log in
How to create a VKontakte conversation using Vk Api?
When using the createChat function, the peer_id of the created conversation is returned, but it is not displayed in the group itself. But, when calling the getConversationsById function, I can see information about it. And when you call getInviteLink, an error 100 is issued, supposedly this is not a conversation at all. I don’t understand how to create a VKontakte conversation using the Vk Api?
def createChat():
return vk_session.method('messages.createChat',
values={'user_ids': 'user_ids', 'title': '1234', 'group_id': group_id})
def getConversationsById(peer_id):
return vk_session .method('messages.getConversationsById',
values={'peer_ids': 2000000000 + peer_id, 'group_id':
vk_session.method('messages.getInviteLink', values={'peer_id': peer_id, 'group_id': group_id})
Answer the question
In order to leave comments, you need to log in
Shalom
Creating a conversation is as follows:
peer = event.peer_id
id_chat = vk.method('messages.createChat', {'user_ids': '*11111111,2222222', 'title': 'Test', 'group_id': peer})
link_chat = vk.method('messages.getInviteLink', {'peer_id': '**2000000004', 'reset': '1', 'group_id': *11111111})
print(link_chat)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question