Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram notification agent lacking support for super groups #5068

Open
goose-ws opened this issue Jan 17, 2024 · 1 comment
Open

Telegram notification agent lacking support for super groups #5068

goose-ws opened this issue Jan 17, 2024 · 1 comment

Comments

@goose-ws
Copy link

Summary

The Telegram notification agent does not seem to support super groups, which allow for messages to be sent to "Topics" (channels/sub-threads) within the group.

For reference, when using curl from shell, one would send a Telegram message via:

https://api.telegram.org/bot[BOT_ID]/sendMessage?chat_id=[CHAT_ID]&text=Test

This is the behavior Ombi currently follows. If the [CHAT_ID] is for a super group, this would send a message to the #General topic of the super group.

To message a specific topic within a super group, it requires appending message_thread_id=[THREAD_ID] to the API call, as such:

https://api.telegram.org/bot[BOT_ID]/sendMessage?chat_id=[CHAT_ID]&message_thread_id=[THREAD_ID]&text=Test

In my super channel, I created a thread for Requests, which has a message_thread_id of 13. Currently there is no field in Ombi in which one could put an optional message_thread_id to be appended to the API call parameters. I tried to hacky workaround by setting my chat ID to -100xxxxxxxxx&message_thread_id=13, but it would seem that was incompatible with the way the chat ID is parsed by Ombi, as the message was still sent to #General. Following that, I turned on trace level logging and found the request being made by Ombi:

REQUEST: { text = This is a test from Ombi, if you can see this then we have successfully pushed a notification!, parse_mode = markdown, chat_id = -100xxxxxxxxxx }

So, in an attempt to break Ombi into doing what I wanted it to do, I modified my Chat id from -100xxxxxxxxxx to -100xxxxxxxxxx, message_thread_id = 13.

The request looks as I would hope:

REQUEST: { text = This is a test from Ombi, if you can see this then we have successfully pushed a notification!, parse_mode = markdown, chat_id = -100xxxxxxxxxx, message_thread_id = 13 }

But the result is the same, it's stil sending to the #General topic/thread, not the one with id = 13.

As a workaround for the time being, I wrote a webhook parser and have Ombi pushing notifications to that, which then issues the API call to Telegram. But it would be great if support for super group threads could be natively built in, rather than relying on my hacked together and poorly written PHP webhook parser.

Ombi Version

4.43.11

What platform(s) does this occur on?

Docker

What database are you using?

MySQL

Relevant log output

No response

@goose-ws
Copy link
Author

For anyone else who comes across this, I ended up making my own PHP webhook to fix this, until official support is added: https://github.com/goose-ws/ombi-webhook/blob/main/webhook.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant