【问题标题】:telegram bot location python电报机器人位置python
【发布时间】:2017-09-11 11:39:35
【问题描述】:

如何使用电报机器人从用户那里获取位置?我试过这个:

location_keyboard = KeyboardButton(text="send_location",  request_location=True)           
contact_keyboard = KeyboardButton(text ='Share contact', request_contact=True) 
custom_keyboard = [[ location_keyboard], [contact_keyboard ]]

【问题讨论】:

  • 您使用的是哪个框架?什么是“键盘按钮”?

标签: python location bots telegram


【解决方案1】:

您需要执行以下操作:

使用以下参数调用sendMessage 函数:

{
 chat_id : 1234,
 text: "your message",
 reply_markup: 
  {keyboard: 
    [
      [{text: "Send Your Mobile", request_contact: true}],
      [{text: "Send Your Location", request_location: true}]
    ]
  }
}

【讨论】:

    猜你喜欢
    • 2017-04-10
    • 2020-10-28
    • 1970-01-01
    • 2017-08-18
    • 1970-01-01
    • 2022-01-01
    • 2021-02-21
    • 1970-01-01
    • 2020-09-25
    相关资源
    最近更新 更多