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: add support for group topic. #1640

Closed
wants to merge 1 commit into from

Conversation

yegle
Copy link

@yegle yegle commented Apr 30, 2023

Similar feature on Tautulli: https://github.com/Tautulli/Tautulli/blob/e9b1db139e96f0d82ff7d047f3a91d5b45a69f45/plexpy/notifiers.py#L3989-L3992

Database Migration

NO

Description

Add the ability to send a notification to the given topic of the group chat.

Screenshot (if UI related)

Todos

  • Tests
  • Translation Keys (./src/NzbDrone.Core/Localization/Core/en.json)
  • Wiki Updates

Issues Fixed or Closed by this PR

@yegle
Copy link
Author

yegle commented Apr 30, 2023

Hmm not sure why the tests are failing. I can't find anything useful by reading the logs.

@yegle
Copy link
Author

yegle commented May 1, 2023

Maybe it's better to cherrypick Sonarr/Sonarr#5548

@Qstick
Copy link
Contributor

Qstick commented May 1, 2023

Maybe it's better to cherrypick Sonarr/Sonarr#5548

Agree

@mynameisbogdan mynameisbogdan added the Status: Waiting for OP Action Required from OP label May 2, 2023
@mynameisbogdan
Copy link
Contributor

Hmm not sure why the tests are failing. I can't find anything useful by reading the logs.

https://dev.azure.com/Prowlarr/a958e221-aeac-4b0e-a862-d8ffe1df4b09/_apis/build/builds/3306/logs/97 shows formatting issues to TelegramService.cs

 
             var requestBuilder = new HttpRequestBuilder(URL).Resource("bot{token}/sendmessage").Post();
 
-            var parts = settings.ChatId.Split(new char[]{'/'}, 2);
+            var parts = settings.ChatId.Split(new[] { '/' }, 2);
 
             var request = requestBuilder.SetSegment("token", settings.BotToken)
                                         .AddFormParameter("parse_mode", "HTML")
                                         .AddFormParameter("text", text)
                                         .AddFormParameter("disable_notification", settings.SendSilently);
             request = request.AddFormParameter("chat_id", parts[0]);
-            if (parts.Length > 1) {
+            if (parts.Length > 1)
+            {
                 request = request.AddFormParameter("message_thread_id", parts[1]);
             }

@mynameisbogdan mynameisbogdan added the Status: Don't Merge Hold up - don't merge this label May 3, 2023
@bakerboy448 bakerboy448 added Area: Notifications Issue is related to Notifications sonarr upstream Issue can / could be fixed by using Sonarr's code labels May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Notifications Issue is related to Notifications sonarr upstream Issue can / could be fixed by using Sonarr's code Status: Don't Merge Hold up - don't merge this Status: Waiting for OP Action Required from OP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants