Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. import time, telepot, requests
  2.  
  3. TOKEN = '680414411:AAEuHZ8tp5nhc6OIrj10kbhjAS8m6lXHAvY' # amarildo
  4. # TOKEN = '461853924:AAHYQa4IoXm09pWCMkc3ceCOvLzYAboCG5o' # cleber
  5.  
  6. users_spy = ['541457245', '321374553']
  7.  
  8. def handle(msg):
  9. content_type, chat_type, chat_id = telepot.glance(msg)
  10.  
  11. print(msg)
  12.  
  13. if content_type == 'text' and str(msg['from']['id']) in users_spy:
  14. '''r = requests.post('https://hooks.slack.com/services/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', json={
  15. "attachments": [
  16. {
  17. "color": "#36a64f",
  18. "author_name": msg['chat']['title'],
  19. "pretext": msg['from']['first_name'] + ' ' + msg['from']['last_name'],
  20. "text": msg['text'],
  21. "ts": msg['date']
  22. }
  23. ]
  24. })'''
  25.  
  26. bot = telepot.Bot(TOKEN)
  27. bot.message_loop(handle)
  28. print('Listening...')
  29.  
  30. while 1:
  31. time.sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement