S
S
Sagiri2020-11-03 14:47:04
Python
Sagiri, 2020-11-03 14:47:04

How to change password via vk_api?

I'm a newbie, I don't understand where the error is in the code,
please tell me)

import vk_api

login = ‘логин’
password = ‘пароль’
old_password = password
new_password = ‘новый пароль’

vk_session = vk_api.VkApi(login, password)
vk_session.auth()
vk = vk_session.get_api()

vk.account.changePassword(old_password, new_password)

When you run the code, you get an error TypeError: __call__() takes 1 positional argument but 3 were given

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-11-03
@SoreMix

There are 17 usage examples on github: https://github.com/python273/vk_api/tree/master/ex...
Accordingly, you need to pass the necessary parameters to the function: https://vk.com/dev/account.changePassword

vk.account.changePassword(old_password=old_password, new_password=new_password)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question