I wrote a script that does not allow the admin of the conversation VC to exclude the user, realized this by the fact that when one is kicked, the fake who came before and came out again invites the first one, and he quits. In the end it turns out that the script does it very quickly and catch and kick fake almost unreal. I implemented it like this:

import vk_api vk_session = vk_api.VkApi("login","password") vk_session.auth() vk = vk_session.get_api() main_join=vk.messages.addChatUser(chat_id=13,user_id=id1) if main_join==1: print("Успешный вход") else: print("Вход не удался") join_user=vk.messages.addChatUser(chat_id=13,user_id=id2) if join_user==1: print("Успешное добавление") else: print("Добавление не удалось") remove_user=vk.messages.removeChatUser(chat_id=13,user_id=id1) if remove_user==1: print("Успешный выход") else: print("Выход не удался") 

But it turns out that I need to run each time to return to the conversation. So how to do it all, so that I can run once and the script itself can determine when I am kicked.

  • one
    infinite loop - while True: - gil9red
  • this is understandable, but my problem is that how to identify whether the user is in a conversation, didn’t find anything in the documentation properly, maybe there is someone who worked with the documentation - Double Mid
  • Get a list of users of the conversation, check whether there is the desired user. And that's it (I haven't had 2 cases since VK API, as with a python - I have a bank of the nervous system - so I can't give an example) - Kir_Antipov
  • @Kir_Antipov and there it is impossible to check the status of the users of the conversation on the page where you left the conversation, specifically I can not make a request because I am not in conversation. It turns out you need to make a request from the page you are kicking and inviting. - Double Mid
  • one
    I think this is a reason for a new question. I do not know the details of the implementation of the library you use, so I can not help here. In general, since you have a very modest functionality - you can implement the sending of requests by handles. I understand, you have the same accounts, so you can manually get endless tokens and then sculpt them into requests yourself - Kir_Antipov

0