我怎样才能用电报发送用户的位置和图表?

2024-04-25 17:02:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经试过在谷歌上搜索这个了。但是我找不到答案。我想通过bot发送用户的位置。以下是最终版本(不起作用):

markup_request = ReplyKeyboardMarkup(resize_keyboard=True).add(
    KeyboardButton('Send your contact ☎️', request_contact=True)
).add(
    KeyboardButton('Send your location 🗺️', request_location=True)
)

@dp.message_handler(commands=['location'])
async def message_for_start(message: types.Message):
    await message.reply('Location', reply_markup=markup_request)

Tags: 答案用户版本sendaddtruemessageyour