I am trying to send a Telegram keyboard with a bot to my account. I have followed TelegramAPI documentation but I am unable. I am using Python 2.7.
So far, this is what I have tried:
import requests
bot_token = 'xxxxxxxxxxxxxxxxxxxxxxxx'
chat_id = 'xxxxxxxxxxxx'
text = "Choose:"
reply_markup={"keyboard":[["Yes","No"],["Maybe"],["1","2","3"]],"one_time_keyboard":True}
data = {'chat_id': chat_id, 'text': text, 'reply_markup': reply_markup}
url ="https://api.telegram.org/bot" + bot_token + "/sendMessage"
r = requests.get(url, data = data)
results = r.json()
print (results)
Python does not crash, but I get a fail response from Telegram API and I don't know why:
{u'error_code': 400, u'ok': False, u'description': u"Bad Request: can't parse reply keyboard markup JSON object"}
Any idea or suggestion is highly appreciated.
Thanks, Ander.