【发布时间】:2017-03-28 04:54:51
【问题描述】:
我们的团队尝试创建 Telegram Bot,我们必须让长消息中的电话号码可点击。有时我们必须向用户发送信息很多但电话号码很少的消息,因此很难获得电话,因为电报只允许复制整个消息。 如果我们在没有任何降价的情况下发送短消息,则电报移动应用程序将突出显示它:
await bot.send_message(chat_id, "Example text with a phone +79991234567")
如果我们使用 Markdown Telegram 也可以让数字成为可点击的:
await bot.send_message(
chat_id,
"Example text with a phone [+79991234567](tel:+79991234567)",
parse_mode='Markdown'
)
虽然如果消息是一个很长的电报,只需忽略数字并且不要解析:
await bot.send_message(
chat_id,
"Example text with a phone [+79991234567](tel:+79991234567)\nwithin a long-long message\nwithin a long-long message\nwithin a long-long message\nwithin a long-long message\nwithin a long-long message\nwithin a long-long message\nwithin a long-long message\nwithin a long-long message\nwithin a long-long message\nwithin a long-long message",
parse_mode='Markdown'
)
有没有办法让 Telegram 将电话号码显示为链接?谢谢
【问题讨论】:
标签: markdown telegram-bot