I’m working on a Telegram bot that sends text messages to users. The users need to modify this text and send it back to the bot. Right now they have to manually copy the text or retype everything which is really slow and annoying.
What I want is when the bot sends a message, there should be a button like “Modify” that when clicked, automatically puts that text into the user’s message input field so they can just edit it quickly.
I looked into using deep links but they only seem to work with /start commands. Is there any way using the Telegram Bot API or other Telegram APIs to automatically fill the user’s input box with text? This would make the whole process much faster for users.
Nope, there’s no way to pre-fill input fields with the Bot API. I hit this same issue building a feedback system where users had to edit templates. Here’s what actually worked: inline keyboards with preset options like “Add Comment” or “Change Priority.” Also, send the original text in monospace with backticks - way easier to select and copy the whole thing. Or break it into steps using conversation flow. Instead of one big text block to edit, users answer specific prompts. The security restrictions suck, but these workarounds can actually make the UX better.
no direct way to do this unfortunately. Telegram doesn’t let bots prefill input fields - I tried this a few months ago. I ended up using reply markup with the text as a quote, so users can tap and hold to select everything quickly. Another trick is wrapping the text in triple backticks for a code block - way easier to copy on mobile.
Nope, can’t be done with Telegram’s Bot API. They don’t let bots mess with the user’s input field for security reasons. Hit the same wall building a translation bot last year. Best workaround I found was inline queries, but users have to type your bot’s username first - pretty clunky. You can send text in code blocks to make copying easier, or add instructions like ‘Copy and modify as needed.’ If the changes are predictable, try inline keyboards with common options. Annoying limitation, but Telegram blocks it to stop malicious bots from hijacking input.