Add suport for Topics in the Telegram sendWhatever functions

The idea is:

Implement support for Topics in the Telegram node. Topics are similar to Slack channels, and they add another level of hierarchy inside of groups.
Currently, if you send messages (or documents, images, video, stickers, location or whatever else) to a supergroup that has Topics enabled, the messages land in the General topic, with no way of controlling it, since the only configurable parameter is the Chat ID, and topics share it, using an additional parameter “message_thread_id” to route to a specific topic.

My use case:

  • Making a bot send messages to a Topic in a group
  • … that’s it :slight_smile:

I think it would be beneficial to add this because:

Currently, there are no ways to send bot messages (of any type, i.e. text, images, audio, location) to a Topic in a supergroup. All messages sent by the bot will land in the General topic. For organization, you may want to route messages to a specific topic (say, sending application logs into an Errors topic, instead of landing in the General topic, where they may get mixed with other messages).

Any resources to support this?

The blog post that introduced Topics
The Telegram Bot API docs

Are you willing to work on this?

Absolutely! In fact, it would give me an excuse to work on the n8n codebase, so that’s a win for me.

Hi @jreyesr,

Thank you very much for your post. Have you solved this use case by any chance? :slight_smile:

Kind regards,
Tarlan Isaev

Hello! I did solve it, but never got around to making the PR.
That being said, another user did create a PR: It’s stuck in the PR queue, though.

That being said, you could definitely take the code that is in the PR linked above, make a new (private) plugin based on the Telegram plugin + the fix, and install it on your N8N instance. See here for instructions, though installing on Docker seems somewhat complex, as you need to compile a Docker image.

I haven’t done that, so I can’t provide guidance. It should work, though.

1 Like

Thank you very much for your reply with the solution :slight_smile:

Ohh, I’ve already self-hosted the stack on DO and spent quite a bit of time with CloudFlare Zero Trust troubleshooting, but don’t want to mess around with Docker compilation atm hehe. Hopefully, they’ll review the set of PR changes soon :slight_smile:

Hi. Is this feature available yet in docker version? Because I cannot find it

Welcome to the community @Fauzi!

It was released with [email protected] on July 14th, 2023. You should see the option “Message Thread ID” under “Additional Fields”.

Thank You found it now