Katherine Kvg
Katherine Kvg

Reputation: 13

Telegram Bot. How set command /cmd in user text input?

I need to create command (for example - /cmd). When user click on this command in list - bot set this command text(/cmd) in user input and user should input argument for this command. How to do this?

Example: I have command /cmd. And when user input is - "/cmd parameter1" it goes to execute command with this parameter. I need to allow the user not to enter "/cmd" - it will add it automatically.

Upvotes: 1

Views: 4131

Answers (1)

0stone0
0stone0

Reputation: 43904

Based on question & comments;

bot set this command text(/cmd) in user input

A regular Telegram bot can't place text in Input field. This is only possible with an Inline bot.

If you wish to 'ask' the user a specific 'argument' based on the /cmd command. You could use an Inline bot, an Keyboard to list all available 'arguments' or ask the user, and 'wait' for a reply.

You could also show all available command with an Keyboard and then change the keyboard to the available arguments with on-the-fly updatable inline-keyboard

Upvotes: 2

Related Questions