import vk_api, vk , json
from config import TOKEN
from vk_api import VkUpload
from vk_api.longpoll import VkLongPoll, VkEventType
from vk_api.utils import get_random_id
from vk_api.keyboard import VkKeyboard , VkKeyboardColor
keyboard = VkKeyboard(one_time = False)
keyboard.add_button('asdd',color=VkKeyboardColor.POSITIVE)
vk_session = vk_api.VkApi(token = TOKEN)
vk = vk_session.get_api()
longpoll = VkLongPoll(vk_session)
upload = VkUpload(vk_session)
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
if event.text.lower() == 'привет':
if event.from_user:
vk.messages.send( user_id = event.user_id, random_id = get_random_id(), message = 'привет')
else:
if event.from_user:
vk.messages.send( user_id = event.user_id, random_id = get_random_id(), message = 'sad;lj?&')
from config import TOKEN
from vk_api import VkUpload
from vk_api.longpoll import VkLongPoll, VkEventType
from vk_api.utils import get_random_id
from vk_api.keyboard import VkKeyboard , VkKeyboardColor
keyboard = VkKeyboard(one_time = False)
keyboard.add_button('asdd',color=VkKeyboardColor.POSITIVE)
vk_session = vk_api.VkApi(token = TOKEN)
vk = vk_session.get_api()
longpoll = VkLongPoll(vk_session)
upload = VkUpload(vk_session)
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.text:
if event.text.lower() == 'привет':
if event.from_user:
vk.messages.send( user_id = event.user_id, random_id = get_random_id(), message = 'привет')
else:
if event.from_user:
vk.messages.send( user_id = event.user_id, random_id = get_random_id(), message = 'sad;lj?&')