Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import vk_api
- import random
- import time
- from vk_api.longpoll import VkLongPoll, VkEventType
- print('ok')
- vk_session = vk_api.VkApi(token='bc28780bf212718f3b0be141e3963133cd8c255efdf55d4dd7cd8a8de02775f62cf9c4619e029a901d7f3')
- longpoll = VkLongPoll(vk_session)
- while True:
- try:
- for event in longpoll.listen():
- if event.type == VkEventType.MESSAGE_NEW:
- if event.to_me == True and event.user_id == -172959149:
- if event.text.find('похоже тебя пытается') != -1:
- time.sleep(random.randint(15,60))
- vk_session.method('messages.send', {'peer_id': -172959149, 'message': 'Проснуться', 'payload': '"button:wakeup"', 'random_id': random.randint(-2147483648, +2147483648)})
- except Exception as e:
- print(e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement