Telegram bot clickable commands in groups but clicking on them mentions the bot

Viewed 1475

I have a Telegram bot (in Node JS).

I sent a list of the commands to BotFather:

command 1 - description 1
command 2 - description 2

It works well in private. When I type "/" I see the list of commands available and when I click on one it sends the message "command 1" on the chat.

But when I do this in a group, although it displays the commands too, when I click it sends this message "command 1@botusername", so it doesn't work.

Why is this happening? I'd like the same behavior on groups.

1 Answers

I think the problem is because you're using the wrong casing system.

/command 1@botusername is not a proper command casing.

When you insert a space between the command name telegram assumes the command has ended at /command and then assumes the rest 1@botusername as either a command payload or just a text so it tags the bot since it's a username.

Anyways you should avoid adding space between a command I recommend using either snake casing or just write them without spaces also known us no casing like this

nocasecommand - description 1 or 
snake_case_command - description 1

I have tried other casings like camelCase or PacsalCase though it works if you write the command down in a group or private. You can't add it to the preset command options because telegram doesn't support uppercase letters in their command options, I guess. For more Check out this image.

Related