Answer the question
In order to leave comments, you need to log in
[15] Access denied when using messages.getHistory on behalf of the community, what should I do?
I'm making a chat bot using the vk_api library for Python.
When trying to get the name of the conversation, the number of messages and the number of participants, it gives an error [15] Access denied.
I use longpoll, the latest version, I gave out all the rights. The code is below.
chat = vk.messages.getHistory(peer_id = event.obj.peer_id,count = 0,extended = 1)
chattitle = chat[0]['chat_settings'][0]["title"]
chatmsgcount = chat[0]["count"]
chatmembercount = chat[0]['chat_settings'][0]["members_count"]
Answer the question
In order to leave comments, you need to log in
bot communities do not save the history of correspondence in conversations, so all messages have id = 0 and the method cannot be called
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question