Answer the question
In order to leave comments, you need to log in
Can't work with the Vk_api list?
In general, I study python and decided to train on bots, I create a bot that should send and immediately pin my message almost succeeded and here
if responsive == '/закрепи':
max_message = session_api.messages.getHistory(peer_id=event.peer_id)['count']
text = []
for i in range(0,max_message,200):
mess = session_api.messages.getHistory(peer_id=event.peer_id, count=200,offset=i)['items']
for element in mess:
if element.get('action') == None:
text.append(str(element['id']))
text = ','.join(text)
print(text)
message_id = text[0]
session_api.messages.pin(peer_id=event.peer_id,message_id=message_id)
86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69
Traceback (most recent call last):
File "bot.py", line 79, in <module>
session_api.messages.pin(peer_id=event.peer_id,message_id=message_id)
File "C:\Users\linkq\AppData\Local\Programs\Python\Python37\lib\site-packages\vk_api\vk_api.py", line 681, in __call__
return self._vk.method(self._method, kwargs)
File "C:\Users\linkq\AppData\Local\Programs\Python\Python37\lib\site-packages\vk_api\vk_api.py", line 646, in method
raise error
vk_api.exceptions.ApiError: [10] Internal server error
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