B
B
Best-404-Error2019-03-11 18:23:37
Python
Best-404-Error, 2019-03-11 18:23:37

Why is my VK bot (group) not working (vk_api, python)?

Hello! It is necessary to make the bot send me at least some message, and the python script does not even want to work (I'm trying to log in as a group) ....
Question: Why?
Here is the code:

import time

import vk_api

vk = vk_api.VkApi(token = 'СКРЫТ В ЦЕЛЯХ БЕЗОПАСНОСТИ')

vk_api = vk.get_api()

LongPoll = vk_api.VkBotLongPoll(vk, 161827083, wait=20)

vk.auth()

Gives an error message:
Traceback (most recent call last):
  File "/home/cheater/Документы/2pb.py", line 9, in <module>
    LongPoll = vk_api.VkBotLongPoll(vk, 161827083, wait=20)
TypeError: __call__() takes exactly 1 argument (4 given)
[Finished in 0.2s]

The token is fully operational.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bqio, 2019-03-11
@bqio

Most likely the library is already outdated. Use vk-io.

V
Vitaly Ogai, 2019-03-13
@ogai22

Read the text of the exception.
The VkBotLongPoll method takes only 1 argument (and that is the current object itself), and for some reason you pass 4 to it.
And in general, the vk_api object does not have such a VkBotLongPoll method. You must have messed something up.
I recommend using vk instead of the vk_api library.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question