Answer the question
In order to leave comments, you need to log in
What to do Python Vk api request not working?
import vk
import json
import time
user_password='*********'
user_login='*********'
app_id='*********'
session=vk.AuthSession(app_id=app_id,user_login=user_login,user_password=user_password,scope='messages')
api =vk.API(session)
chat_id= 26
print("Начало работы")
print("Захожу в беседу")
print("Добавляю тебя в беседу")
r = api.messages.addChatUser(chat_id=chat_id,user_id=242352092)
time.sleep(1)
if r!=1:
print("Ошибка,не удалось тебя добавить в беседу")
api.messages.removeChatUser(chat_id=chat_id,user_id=381887204)
print("Вышел из беседы")
else:
api.messages.removeChatUser(chat_id=chat_id, user_id=381887204)
print("Вышел из беседы")
Traceback (most recent call last):
File "C:/Users/kirill/Desktop/Божеские разаработки на Python/Антикик из беседы/main.py", line 19, in <module>
r = api.messages.addChatUser(chat_id=chat_id,user_id=242352092)
File "C:\Users\kirill\AppData\Local\Programs\Python\Python36-32\lib\site-packages\vk\api.py", line 173, in __call__
return self._api._session.make_request(self)
File "C:\Users\kirill\AppData\Local\Programs\Python\Python36-32\lib\site-packages\vk\api.py", line 102, in make_request
raise error
vk.exceptions.VkAPIError: 10. Internal server error. request_params = {'oauth': '1', 'method': 'messages.addChatUser', 'chat_id': '26', 'user_id': '242352092'}
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