L
L
Link-Z2020-04-29 21:04:13
Python
Link-Z, 2020-04-29 21:04:13

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)


here is the error:
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

2 answer(s)
T
Timur Pokrovsky, 2020-04-29
@Link-Z

This VK is stupid
https://vk.com/faq11852

D
Dev12345, 2020-04-29
@Dev12345

Internal server error code 10. This error occurs on our side, on our servers. It is worth waiting a little and repeating the request again. If it repeats over and over again, you need to contact us.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question