A
A
alex-bul2019-05-02 21:49:24
Python
alex-bul, 2019-05-02 21:49:24

How to solve wall.post method error in Python?

Here is my code:

import vk_api

id = 242306128
vk = vk_api.VkApi(token="*здесь находится токен от группы*")
vk._auth_token()
vk.method("wall.post", {"owner_id": -180510660,"message":'Новая покупка!🔥\n\[email protected]' + str(id) + "(" + str(
                vk.method("users.get", {"user_ids": id})[0]['first_name']) + str(
                vk.method("users.get", {"user_ids": id})[0]['last_name']) + ") - " + str(1222) + " коинов!"})

For some reason, the error vk_api.exceptions.ApiError: [5] User authorization failed: method is unavailable with group auth occurs, although there is an authorization token. What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-05-02
@KOT10

If you do not know English at all, then shove the error "method is unavailable with group auth" into the translator and understand that the group token does not give rights to call this method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question