telegram bot prefill text for user to edit

左心房为你撑大大i 提交于 2020-06-24 11:44:10

问题


Telegram bot sends me a message with a text snippet, which I want to edit, and send back to the bot for further processing.

Copy and paste takes time. Typing message anew takes time.

Ideally I'd like to press an inline button "Edit" on the bot's message and get the message text appear in my reply input box for editing.(A message id attached to my reply somehow would be a plus).

I tried to use deep linking with parameters other than /start*, but that doesn't seem to work.

Can I use bot API (or any other telegram API) to have text ready for editing in my input box?


回答1:


It's impossible in official apps yet. Your question is about working with drafts - there are no methods in both API to create them or clear.


Nevertheless, you could fork any official app stored on GiHub and implement what you need if you would prefer a hard way, but compared to that copy/past solution seems much more easier, isn't it?


UPD

I can offer to you a new idea how to solve your problem - hope it will be helpful.

This is about switch_inline_query_current_chat field of InlineKeyboardButton. Just attach an inline button to messages you need to edit. Set a text for this field gotten from recieved message and after pressing you will get this text to your input area. All seems good, but you will take bot's username before the text also.



来源:https://stackoverflow.com/questions/45363113/telegram-bot-prefill-text-for-user-to-edit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!