d_skat

Untitled

May 11th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. token = ''
  2. url = 'https://api.telegram.org/bot{}/'.format(token)
  3.  
  4.  
  5. def send_message(chat_id, text, reply_markup=None):
  6.     URL = url + \
  7.         "sendMessage?text={}&chat_id={}&parse_mode=Markdown".format(
  8.             text, chat_id)
  9.     if reply_markup:
  10.         URL += '&reply_markup={}'.format(reply_markup)
  11.     res = requests.get(URL)
  12.     while res.status_code != 200:
  13.         res = requests.get(URL)
Advertisement
Add Comment
Please, Sign In to add comment