Guest User

Untitled

a guest
Feb 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import requests
  2. from handler import handle_message
  3.  
  4. while True:
  5. res = request.get("...")
  6. d = res.json()
  7.  
  8. for elem in d["result"]:
  9. text = elem["message"]["text"]
  10. ans = handle_message(text)
  11.  
  12. chat_id = elem["message"]["chat"]["id"]
  13.  
  14. requests.post("...", params={ "chat_id": chat_id, "text": text } )
Add Comment
Please, Sign In to add comment