title: Python Telegram API ReplyKeyboardMarkup
body: <p>I am new to python. I am trying to send a response showing a custom keyboard with two buttons to the user in Telegram app but it gives me an error about encode.</p>
  
  <p>I would like to know where is my mistake.</p>
  
  <pre><code>import json
  from urllib.request import urlopen
  from urllib.parse import quote, unquote
  import time
  
  def Decode(telegram_response):
      decoded=''
      for line in telegram_response:
          decoded=decoded+line.decode('utf-8')
      return decoded
  
  TOKEN = 'mytoken'
  URL = 'https://api.telegram.org/bot{}/'.format(TOKEN)
  cmd = 'getme'
  
  telegram_response = urlopen(URL + cmd)
  decoded = Decode(telegram_response)
  gtm = json.loads(decoded)
  
  status = True
  while status:
      cmd = 'getUpdates'
  
      telegram_response = urlopen(URL + cmd)
      decoded = Decode(telegram_response)
      upds = json.loads(decoded)
  
      new_message = len(upds['result'])
  
  if new_message !=0:
  
      msg = upds['result'][0]['message']
      chat_id = str(msg['chat']['id'])
  
  
      reply_markup = {'keyboard': [[{'text':'first button'}],[{'text':'second button'}]], 'resize_keyboard': True, 'one_time_keyboard': True}
      reply_markup = json.dumps(reply_markup)
  
      params = ({'chat_id': chat_id, 'reply_markup': reply_markup, 'disable_web_page_preview': 'true'})
      myresponse =urlopen(URL + 'sendMessage' + quote((params).encode('utf-8')))
  </code></pre>