Failed to call /setMyCommands to catch as reply message
nkgiovannivl opened this issue · 5 comments
Hi all,
Using the functionality 'Register at telegram server' on 'command node' to register a command as reply get a error:
This kind of command it's called when in my group the boot as mentioned in reply of a message answer:
But if in node configuration set without @, it works (I need to use update de bot config option to take this kind on changes not just change de command node options)
So, the steps to reproduce:
- On telegram add the bot to a group.
- On telegram select any message and select reply to message.
- On telegram select any bot command palette (/) and reply.
- On node red edit 'command node' and set ''Register at telegram server'' option and type the command (/command@bot_name_bot)
- Press the pencil to edit the bot and press update to take the changes.
- Deploy the flow.
well adding @ to a command is not allowed by telegram.
Maybe there is a misunderstanding here. If you use the bot in groups you should enable the strict in groups option.
https://core.telegram.org/bots/api#botcommand
Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores
well adding @ to a command is not allowed by telegram. Maybe there is a misunderstanding here. If you use the bot in groups you should enable the strict in groups option.
well, I'm still stuck, I'm already set your suggestion in "command node" (error disappear):
But I'm not catch the command requested to my bot using "command node"
I see the command using "receiver node"
Need I use "command node" to configure the command bot and the "receiver node" to check the content and verify if it is a command? or am I'm missing something to filter the command on "command node" to include @botName in the command filter?
Thanks for your support!
The command node receives messages like a receiver node but it only passes the message to its output if the message starts with the configured command. The receiver node receives everything. But there is an option in the receiver node to filter away all commands that are already handled by all other command nodes.
Now you have two options:
- Only use a receiver node and do the filtering in a function node after the receiver node
- or just use command nodes and the receiver node with filtering on
The command node checks if a message:
- starts with /
- if the command is from a group chat (<0) or a private chat (>0) --> strict mode
- if the command ends with @botName
if so then the message is passed through
The command node receives messages like a receiver node but it only passes the message to its output if the message starts with the configured command. The receiver node receives everything. But there is an option in the receiver node to filter away all commands that are already handled by all other command nodes.
Now you have two options:
- Only use a receiver node and do the filtering in a function node after the receiver node
- or just use command nodes and the receiver node with filtering on
The command node checks if a message:
- starts with /
- if the command is from a group chat (<0) or a private chat (>0) --> strict mode
- if the command ends with @botName
if so then the message is passed through
OK I found my problem, in the config node, I was using my Bot-Name (as guide explains), but I need to use Bot-UserName (ends with _bot and without @) to get command node work properly, so the 3th point of your explanation take sense.
Thanks!