Answer the question
In order to leave comments, you need to log in
Error when pinning a message by the bot, what should I do?
When a message is pinned by the bot, an error occurs:
Traceback (most recent call last):
File "", line 299, in
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3. 8/site-packages/vk_api/vk_api.py", line 646, in method
raise error
vk_api.exceptions.ApiError: [925] You are not admin of this chat
Granted admin rights to the bot, code:
if textt[0] == ".pin":
id3 = event.peer_id
from_id_ = vk_session.method('messages.getById',{'message_ids':[event.message_id]})['items'][0]['reply_message']['from_id']
vk_session.method('messages.pin', {'peer_id' : id3, 'message_id' : from_id_})
sender(id3, "Сообщение закреплено!")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question