Response path for telegram group topic

(Fabio) #1

I am trying to figure out how to send a message to a group topic thread in telegram. Telegram topics are a sort of sub-group that allows to split a group in multiple subgroups, all with the same users, to keep topics cleanly separated.

The telegram bot API page ( https://core.telegram.org/bots/api#sendmessage ) shows that there is a way to address a specific topic (thread via the message_thread_id parameter) when sending a message. I am not sure how to do this in FlowXO. I thought to use the response path as usual, as in telegram web a topic has the same response path, but with a suffix such as “_8” for the specific topic, but it does not work.

Anyone managed to do this?

Thanks in advance for the help
fabio

(Nathan Stults) #2

Fabio,

We just added “Message Thread ID” as both a metadata field for incoming forum messages and a parameter you can set for outgoing messages when using Telegram Actions. See this brief sample:

https://flowxo.com/share/composite-chips-314

(Fabio) #3

Oh Wow!
this works great, and this was by far the best feature request response I ever got! Congratulations and thanks!

(Fabio) #4

Hi Nathan
coming back to this thread as I just noticed that the Telegram Send Message is probably not taking into account the thread ID from the incoming response_path.
What I am referring to is that while a bot in a forum (ie group with threads activated) will correctly receive a message/command/request, when one writes a message back, the message goes to the general thread (probably thread ID 0) instead of going to the thread which originated the initial command instead.
Is this a bug?

Let me know if the above is clear

(Nathan Stults) #5

Hi,

That is not a bug. The topic of a forum is not part of the chat identifier in Telegram, and therefore not part of the response path, and so the reply doesn’t know how to automatically address a topic.

You will need to extract the topic ID from the incoming metadata, then set that same topic ID on outgoing messages.

Nathan

(Fabio) #6

This was very helpful. Indeed, it worked perfectly as you suggested.
Thanks a lot for the quick response!

fabio