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 notifications are not sent when longer than 4096 chars #222

Open
davtur19 opened this issue Jan 11, 2022 · 4 comments · May be fixed by #251
Open

Telegram notifications are not sent when longer than 4096 chars #222

davtur19 opened this issue Jan 11, 2022 · 4 comments · May be fixed by #251
Assignees
Labels
Service: Telegram Related to the Telegram Service Type: Enhancement New feature or request

Comments

@davtur19
Copy link

Describe the bug
I get this error when I have too many containers that need updating or fail:

Failed to send notification via shoutrrr (url=telegram://1234:AA1234BCDEF@telegram?channels=225533):  message exceeds the max length

The problem is that Telegram does not support messages longer than 4096 characters

Possible solution
A simple fix would be to split the message once it reaches 4096 characters (preferably when there is a newline before the 4096 character, to have it cleaner to see).

To avoid problems with Telegram, you could send a warning message if it is longer than 20(?) messages (4096 * 20 characters), saying that it is impossible to send all notifications because they are too long to display in Telegram, is better than not receiving a warning at all.

To Reproduce
Steps to reproduce the behavior:

  1. Create many containers that need to be updated in order to have a long message
  2. Wait for the watchtower update check
  3. See error

Expected behavior
Receive notifications on Telegram when a message is too long

Environment
I am using containrrr/watchtower:latest image (arm64).
Docker version 20.10.12, build e91ed57

@github-actions
Copy link

Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏

@piksel piksel transferred this issue from containrrr/watchtower Jan 22, 2022
@piksel piksel changed the title Telegram notifications are not sent Telegram notifications are not sent when longer than 4096 chars Jan 22, 2022
@piksel piksel added Service: Telegram Related to the Telegram Service Type: Bug Something isn't working labels Jan 22, 2022
@piksel piksel added Type: Enhancement New feature or request and removed Type: Bug Something isn't working labels May 29, 2022
@hasechris
Copy link

@piksel Hey, could this be merged? This is quite old.

@piksel
Copy link
Member

piksel commented Dec 2, 2023

I will take a look at the PR and try to figure out what is left to do...

@piksel piksel self-assigned this Dec 2, 2023
@drorengel
Copy link

is this fixed? I have this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Service: Telegram Related to the Telegram Service Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants