Answer the question
In order to leave comments, you need to log in
Bot in vk \ appeal to vk.api. How to do?
I'm making a bot for a school conversation. Something like this happens, but I want him to be able to kick through the team. As far as I know, this can only be done with a direct call to vk_api, via http, but I don’t understand how to proceed. Because the code in print is huge.
Answer the question
In order to leave comments, you need to log in
Install vk_api (pip install vk_api) and make a request
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import vk_api
def main():
login, password = 'LOGIN', 'PASSWORD'
vk_session = vk_api.VkApi(login, password)
try:
vk_session.auth()
except vk_api.AuthError as error_msg:
print(error_msg)
return
vk = vk_session.get_api()
response = vk.messages.removeChatUser(chat_id=ID_CHAT, user_id=ID_USER)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question