You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
прикрепляю код написанный
import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType
def auth():
login = '+логин'
password = 'пароль'
vk_session = vk_api.VkApi(login, password)
vk_session.auth()
vk = vk_session.get_api()
try:
vk_session.auth(token_only=True)
except vk_api.AuthError as error_msg:
print(error_msg)
return
long = VkLongPoll(vk_session)
for event in long.listen():
if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
if event.text == 'Привет':
if event.from_user:
vk.messages.send(
user_id=event.user_id,
message='Привет'
)
elif event.text == 'Пока':
if event.from_user:
vk.messages.send(
user_id=event.user_id,
message='Пока'
)
if name == "main":
auth()
и Выдает следующую ошибку
Traceback (most recent call last):
File "D:\bot\main.py", line 35, in
auth()
File "D:\bot\main.py", line 16, in auth
long = VkLongPoll(vk_session)
File "D:\bot\venv\lib\site-packages\vk_api\longpoll.py", line 515, in init
self.update_longpoll_server()
File "D:\bot\venv\lib\site-packages\vk_api\longpoll.py", line 529, in update_longpoll_server
response = self.vk.method('messages.getLongPollServer', values)
File "D:\bot\venv\lib\site-packages\vk_api\vk_api.py", line 697, in method
raise error
vk_api.exceptions.ApiError: [15] Access denied: no access to call this method
The text was updated successfully, but these errors were encountered:
К сожалению, с 15 февраля 2019 API vk.com закрыл доступ на чтение сообщений для приложений,
не прошедших верификацию.
Официальный анонс: https://vk.com/dev/messages_api
Разъяснение, что приложение не должно содержать автоматизацию пользовательских действий
(увы, наш случай) https://vk.com/wall-1_390510
Присоединиться к негодующим можно здесь https://vk.com/wall-1_389441
прикрепляю код написанный
import vk_api
from vk_api.longpoll import VkLongPoll, VkEventType
def auth():
login = '+логин'
password = 'пароль'
vk_session = vk_api.VkApi(login, password)
vk_session.auth()
vk = vk_session.get_api()
try:
vk_session.auth(token_only=True)
except vk_api.AuthError as error_msg:
print(error_msg)
return
long = VkLongPoll(vk_session)
for event in long.listen():
if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
if event.text == 'Привет':
if event.from_user:
vk.messages.send(
user_id=event.user_id,
message='Привет'
)
elif event.text == 'Пока':
if event.from_user:
vk.messages.send(
user_id=event.user_id,
message='Пока'
)
if name == "main":
auth()
и Выдает следующую ошибку
Traceback (most recent call last):
File "D:\bot\main.py", line 35, in
auth()
File "D:\bot\main.py", line 16, in auth
long = VkLongPoll(vk_session)
File "D:\bot\venv\lib\site-packages\vk_api\longpoll.py", line 515, in init
self.update_longpoll_server()
File "D:\bot\venv\lib\site-packages\vk_api\longpoll.py", line 529, in update_longpoll_server
response = self.vk.method('messages.getLongPollServer', values)
File "D:\bot\venv\lib\site-packages\vk_api\vk_api.py", line 697, in method
raise error
vk_api.exceptions.ApiError: [15] Access denied: no access to call this method
The text was updated successfully, but these errors were encountered: