Advertisement
MrNanoDragon

Untitled

Jan 29th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import vk_api
  2. import random
  3. import time
  4. from vk_api.longpoll import VkLongPoll, VkEventType
  5.  
  6. print('ok')
  7.  
  8. vk_session = vk_api.VkApi(token='bc28780bf212718f3b0be141e3963133cd8c255efdf55d4dd7cd8a8de02775f62cf9c4619e029a901d7f3')
  9. longpoll = VkLongPoll(vk_session)
  10.  
  11. while True:
  12. try:
  13. for event in longpoll.listen():
  14. if event.type == VkEventType.MESSAGE_NEW:
  15. if event.to_me == True and event.user_id == -172959149:
  16. if event.text.find('похоже тебя пытается') != -1:
  17. time.sleep(random.randint(15,60))
  18. vk_session.method('messages.send', {'peer_id': -172959149, 'message': 'Проснуться', 'payload': '"button:wakeup"', 'random_id': random.randint(-2147483648, +2147483648)})
  19. except Exception as e:
  20. print(e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement