Найти - Пользователи
Полная версия: Выдает такую ошибку "vk_api.exceptions.ApiError: [15] Access denied: no access to call this method"
Начало » Python для новичков » Выдает такую ошибку "vk_api.exceptions.ApiError: [15] Access denied: no access to call this method"
1
MeerkeL1337
Код:
import vk_api
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
from config import tok

vk_session = vk_api.VkApi(token = tok)
longpoll = VkBotLongPoll(vk_session, 207817235)

def sender(id, text):
vk_session.method('messages.get', {'chat_id' : id, ‘message’ : text, ‘random_id’ : 0})

for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW:
if event.from_chat:

id = event.chat_id
msg = event.object.message.lower()

if msg == ‘Привет’:
sender(id, ‘Приветсвую!’)

пишу его на Sublime Text

вот полная ошибка при билде
Traceback (most recent call last):
File “D:\My\Bot VK\main.py”, line 6, in <module>
longpoll = VkBotLongPoll(vk_session, 207817235)
File “C:\Users\WWW\AppData\Local\Programs\Python\Python310\lib\site-packages\vk_api\bot_longpoll.py”, line 219, in __init__
self.update_longpoll_server()
File “C:\Users\WWW\AppData\Local\Programs\Python\Python310\lib\site-packages\vk_api\bot_longpoll.py”, line 232, in update_longpoll_server
response = self.vk.method('groups.getLongPollServer', values)
File “C:\Users\WWW\AppData\Local\Programs\Python\Python310\lib\site-packages\vk_api\vk_api.py”, line 668, in method
raise error
vk_api.exceptions.ApiError: Access denied: no access to call this method


ЧТО ДЕЛАТЬ?)
py.user.next
MeerkeL1337
vk_api.exceptions.ApiError: Access denied: no access to call this method
Это надо права дать боту. Скрипт тут ни при чём.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB