import vk_api, config, random
from vk_api.longpoll import VkLongPoll, VkEventType
login = config.login
password = config.password
vk_session = vk_api.VkApi(login, password)
vk_session.auth()
session_api = vk_session.get_api()
longpoll = VkLongPoll(vk_session)
while True:
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
print("Текст принятого сообщения: " + str(event.text))