telegram bot prefill text for user to edit
Asked Answered
S

1

13

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?

Shelby answered 28/7, 2017 at 0:38 Comment(0)
A
11

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.

Acrefoot answered 31/7, 2017 at 8:31 Comment(3)
Could you clarify a little what apps are you talking about and what the hard way would look like?Shelby
1. Fork your own copy of official app from list above, for example - android app 2. Implement your own mechanism of working with drafts 3. Build new app 4. Use it and enjoy with your new featureAcrefoot
Note that it is not serious recommendation if you took it seriously. This is just a possible way but very hard wayAcrefoot

© 2022 - 2024 — McMap. All rights reserved.