Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get a Telegram bot to put some text into the user's message input box?

Tags:

telegram-bot

I'm building a Telegram bot, in which the user sends messages, which are later posted to another website. The bot can often give the user a suggestion of what to write, but the user must have a chance to edit this suggestion before actually posting it.

I could send this suggestion as a message from the bot to the user, and the user could copy and paste it to the message input box. However, copying and pasting is a bit cumbersome, especially on a touch device. It would be much more convenient if I could put the text directly into the editing box.

Is it possible?

I am now using the Tgfancy library, but I don't mind using another library if it has this feature.

Thank you!

like image 971
Amir E. Aharoni Avatar asked Jun 24 '17 14:06

Amir E. Aharoni


People also ask

Can a Telegram bot send message to user?

In order to send a message to "@Username", you will need them to start your bot, and then store the username with the user_id. Then, you can input the username to find the correct user_id each time you want to send them a message.

Can Telegram bots edit messages?

Only the inline bot can edit message.

How do you edit a text box in Telegram?

Once you have Telegram open, tap on the three-lined menu at the top left. When the side-menu appears, tap on the Settings option. Once you're in Settings, look for and tap on the Chat Settings option. In Chat Settings, you'll see a slider at the top.


1 Answers

switch_inline_query_current_chat of InlineKeyboardButton is what is needed to pre-fill the text area with your inline query parameter

like image 136
isaacalan Avatar answered Sep 23 '22 16:09

isaacalan