What to do if it throws this error?

Gives this error code
Traceback (most recent call last):
File "bots.py", line 14, in
add = VkLongPoll(vk_session)
File "C:\Users\DNS\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vk_api\longpoll.py", line 517, in __init__
self.update_longpoll_server()
File "C:\Users\DNS\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vk_api\longpoll.py", line 531, in update_longpoll_server
response = self.vk.method('messages.getLongPollServer', values)
File "C:\Users\DNS\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vk_api\vk_api.py", line 640, in method
raise error
vk_api.exceptions.ApiError: [15] Access denied: no access to call this method


The code itself:
import vk_api
from vk_api.add import VkLongPoll, VkEventType
import random
import time
from datetime import datetime, timedelta

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

add = VkLongPoll(vk_session)

for event in add.listen():
 if event.type == VkEventType.MESSAGE_NEW:
 print('the Message came in:' + str(event.datetime + timedelta(hours=3)))
 print('message:' + str(event.text))
print(event.peer_id)

 response = event.text.lower()
 if event.from_chat or event.from_user:
try:
 if response == '/status' or response == '/status':

 today = datetime.strftime(datetime.now(), "%d%m%Y")
 tomorrow = datetime.strftime(datetime.now() + timedelta(days=1), "%d%m%Y")

vk.messages.send(
peer_id=event.peer_id,
 random_id=random.randint(-2147483648, +2147483648),
 message='Only messages in this dialog :' +
 str(vk.messages.search(peer_id=event.peer_id, date=tomorrow, count=1)['count'] + 1) + '\PPA today: '+
 str( vk.messages.search(peer_id=event.peer_id, date=tomorrow, count=1)['count'] + 1 - vk.messages.search(peer_id=event.peer_id, date=today, count=1)['count'] + 1),
)
 elif response.split(' ')[0] == '/add':
print(vk.messages.getChat(chat_id=event.chat_id)['admin_id'])
 if vk.messages.getChat(chat_id=event.chat_id)['admin_id'] == event.user_id:
try:
 vk.messages.addChatUser(chat_id=event.chat_id, user_id=response.split(' ')[1])
except:
vk.messages.send(
peer_id=event.peer_id,
 random_id=random.randint(-2147483648, +2147483648),
 message='Error when adding user.'
)
else:
vk.messages.send(
peer_id=event.peer_id,
 random_id=random.randint(-2147483648, +2147483648),
 message='You can not hold a new member is added this way, as I am not the Creator of the conversation.'
)

 elif response.split(' ')[0] == '/kick':
print(vk.messages.getChat(chat_id=event.chat_id)['admin_id'])
 if vk.messages.getChat(chat_id=event.chat_id)['admin_id'] == event.user_id:
try:
 vk.messages.removeChatUser(chat_id=event.chat_id, user_id=response.split(' ')[1])
except:
vk.messages.send(
peer_id=event.peer_id,
 random_id=random.randint(-2147483648, +2147483648),
 message='Error while deleting user.'
)
else:
vk.messages.send(
peer_id=event.peer_id,
 random_id=random.randint(-2147483648, +2147483648),
 message='You can not hold a removing party in such a way, as I am not the Creator of the conversation.'
)
 elif response == '/time':
vk.messages.send(
peer_id=event.peer_id,
 random_id=random.randint(-2147483648, +2147483648),
 message='Current time :' + str(event.datetime + timedelta(hours=3))
)
except:
pass

finally:
 time.sleep(3)


Wanted to take this code basis, but gives an error
April 3rd 20 at 17:41
2 answers
April 3rd 20 at 17:43
Solution
There is no access to the methods section messages.
And never will be.
Write a bot for the group, not for personal pages.
April 3rd 20 at 17:45
Decided on, but now this error
File "bots.py", line 13, in
for event in add.listen():
File "C:\Users\DNS\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vk_api\longpoll.py", line 621, in listen
for event in self.check():
File "C:\Users\DNS\AppData\Local\Programs\Python\Python37-32\lib\site-packages\vk_api\longpoll.py", line 560, in check
timeout=self.wait + 10
TypeError: can only concatenate str (not "int") to str


Code from above

Find more questions by tags PythonVKontakteBots