Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if command.startswith('/rank '):
- rank(msg)
- def rank(msg):
- chat_id = msg['chat']['id']
- command = msg['text']
- user = msg['text'][6:]
- graphUrl = 'https://www.website.com/servlet/graph/' + user + '-in_US.png'
- print graphUrl
- theGraph = urllib2.urlopen(graphUrl)
- bot.sendPhoto(chat_id, theGraph, caption=('rank graph for ' + user + '.'))
- # Error:
- # 2016-12-30T17:17:50.803142+00:00 app[worker.1]: TelegramError: (u'Bad Request: Photo has unsupported extension. Use one of .jpg, .jpeg, # .gif, .png, .tif or .bmp', 400, {u'ok': False, u'description': u'Bad Request: Photo has unsupported extension. Use one of .jpg, .jpeg, # .gif, .png, .tif or .bmp', u'error_code': 400})
Advertisement
Add Comment
Please, Sign In to add comment