A
A
Alexey Poloz2018-03-06 20:24:54
Python
Alexey Poloz, 2018-03-06 20:24:54

Python VK_Api Why can't login with community permissions?

Everything works for the user, but not with community rights. Even though this code worked before. Not now. What's wrong?

import vk_api

vk = vk_api.VkApi(token='блаблатокенбла')
vk.auth()

vk.method('messages.send', {'user_id': 'блаюзер', 'message': 'сообщениебла'})

Traceback (most recent call last):
  File "main.py", line 4, in <module>
    vk.auth()
  File "/usr/local/lib/python3.6/site-packages/vk_api/vk_api.py", line 143, in auth
    raise LoginRequired('Login is required to auth')
vk_api.exceptions.LoginRequired: Login is required to auth

a token from a group, but if I add a username and password from a user, then he simply enters the user and performs actions on his behalf, and not on the community.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Poloz, 2018-03-20
@kosyachniy

vk.auth()- only needed when authorizing a user
When authorizing with group access rights - no

F
frost_yeah, 2018-07-21
@froz_yeah

I know that it is very relevant, but - vk._auth_token()a function for authorizing the community by token

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question