电报机器人定位蟒蛇 [英] telegram bot location python

查看:10
本文介绍了电报机器人定位蟒蛇的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

推荐答案

您需要执行以下操作:

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

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

这篇关于电报机器人定位蟒蛇的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆