Commit Graph

28 Commits (cc36ebf1c9191a6107637b26bd3dbc802f91eb4a)

Author SHA1 Message Date
Alexander cc36ebf1c9
Add UseFullName option (telegram) (#1777) 2 years ago
ValdikSS c51753cab1
Fix for complex-formatted Telegram text (#1765)
* Telegram: handle entities before everything

* Telegram: use runes for text entities

* Telegram: use proper offset and runes for links

* Telegram: put newline after backticks for pre

* Telegram: use utf16 for entity processing
2 years ago
ValdikSS 9c203327c0
Fix Telegram channel title in forwards (#1753)
Forward from channels requires different handling than forward from the regular users.
This patch fixes the issue: it prints channel title instead of "forwarded from unknown".
2 years ago
Jan Martin Reckel ccb5b1d075
Fix Telegram Problem (unforwarded formatting and skipping of linebreaks) (#1749)
* Change bridge/telegram/handlers.go

Comment out the removing of empty lines
add support for bold, italic and striked telegram messages

* Implement Telegram MessageEntities correctly

* Apply gofmt

Co-authored-by: Jan Martin Reckel <jan-martin.reckel@s2017.tu-chemnitz.de>
Co-authored-by: Wim <wim@42.be>
2 years ago
Wim 4b226a6a63
Add support for sender_chat (telegram) (#1677)
* Add support for sender_chat (telegram)

Fixes #1654
https://core.telegram.org/bots/api#december-7-2021

* Add debuglevel option

Add `debuglevel=1` in telegram config to increase debug
2 years ago
Ivan Zuev 4801850013
Add Telegram Bot Command /chatId (telegram) (#1703)
* feat(telegram): command to get chat id

* Gofumpt

Co-authored-by: Ivan Zuev <i-zuev@yandex-team.ru>
Co-authored-by: Wim <wim@42.be>
2 years ago
Wim 02e3d7852b
Update telegram-bot-api to v5 (#1660) 3 years ago
Wim 658bdd9faa
Fix telegram/handlers.go linting (#1658) 3 years ago
Dan Walmsley b275efaeff
Add support for code blocks in telegram (#1650)
* handle code blocks in telegram.

* support multi-line code blocks.

* remove import.

* handle code blocks in middle of normal text.

* support multiple code blocks in same message.
3 years ago
Benau 53cafa9f3d
Convert .tgs with go libraries (and cgo) (telegram) (#1569)
This commit adds support for go/cgo tgs conversion when building with the -tags `cgo`
The default binaries are still "pure" go and uses the old way of converting.

* Move lottie_convert.py conversion code to its own file

* Add optional libtgsconverter

* Update vendor

* Apply suggestions from code review

* Update bridge/helper/libtgsconverter.go

Co-authored-by: Wim <wim@42.be>
3 years ago
Paul b293e3fa75
Adding caption to send telegram images. Fixes #1357 (#1358)
* Used tgbotapi caption option to attach caption to photos / documents

* remove "text/template/parse"

* added TGGetParseMode to clean up. Added tg upload function for video, audio and voice

* fixed varname Textout. Changed fileextension logic to avoid chaining regex

* fixed textout varname

* fixed parsemode varname

* gofmt

Co-authored-by: Wim <wim@42.be>
3 years ago
Wim be3dfb251d
Check rune length instead of bytes (telegram). Fixes #1409 (#1412) 3 years ago
Paul b039da1eba
Add jpe as valid image filename extension (telegram) (#1360) 4 years ago
Wim 16fde6935c
Rename .oga audio files to .ogg (telegram) (#1349) 4 years ago
Ben Wiederhake b2af76e7dc
Support Telegram animated stickers (tgs) format (#1173)
This is half a fix for #874

This patch introduces a new config flag:
- MediaConvertTgs

These need to be treated independently from the existing
MediaConvertWebPToPNG flag because Tgs→WebP results in an
*animated* WebP, and the WebP→PNG converter can't handle
animated WebP files yet.

Furthermore, some platforms (like discord) don't even support
animated WebP files, so the user may want to fall back to
static PNGs (not APNGs).

The final reason why this is only half a fix is that this
introduces an external dependency, namely lottie, to be
installed like this:

$ pip3 install lottie cairosvg

This patch works by writing the tgs to a temporary file in /tmp,
calling lottie to convert it (this conversion may take several seconds!),
and then deleting the temporary file.
The temporary file is absolutely necessary, as lottie refuses to
work on non-seekable files.
If anyone comes up with a reasonable use case where /tmp is
unavailable, I can add yet another config option for that, if desired.

Telegram will bail out if the option is configured but lottie isn't found.
4 years ago
Andrey Groshev a94fe55886
Fix MarkdownV2 support in Telegram (#1169) 4 years ago
Wim 274fb09ed4
Fix forward from hidden users (telegram). Closes #1131 (#1143)
Use ForwardDate to check if a message is forwarded.
If we have a nil ForwardedFrom then make this an unknown user.
4 years ago
Wim e343db6f72
Make avatars download work with mediaserverdownload (telegram). Fixes #920 (#1012) 4 years ago
Humorhenker fc30b1bacc
Add QuoteLengthLimit option (telegram) fixes #963 (#985)
* QuoteLengthLimit option added to limit max. quoted message length if QuoteLengthLimit = 0 the whole message will be quoted
4 years ago
Wim 1fb91c6316
Fix panic by checking slice bounds in handleEntities (telegram). Fixes #857 (#858)
Besides the bound checking, this now also use utf16 as suggested by
https://github.com/go-telegram-bot-api/telegram-bot-api/issues/231
5 years ago
Wim 01d0a9f412 Handle nil message (telegram). Fixes #777 5 years ago
Wim 8cc2d3b4fe Revert "Bail if any vars are nil, not if all (telegram) (#778)"
This reverts commit efd2c99862.
5 years ago
David Hill efd2c99862 Bail if any vars are nil, not if all (telegram) (#778) 5 years ago
Wim f57370f33a
Add support for URL in messageEntities (telegram). Fixes #735 (#736) 5 years ago
Wim 26a7e35f27
Add MediaConvertWebPToPNG option (telegram). (#741)
* Add MediaConvertWebPToPNG option (telegram).

When enabled matterbridge will convert .webp files to .png files
before uploading them to the mediaserver of the other bridges.

Fixes #398
5 years ago
Wim bfa9a83d31
Refactor telegram (#649)
* Decrease complexity in Send() (makes codeclimate happy)
6 years ago
Wim 7923cfe8f8 Fix telegram crash #620 6 years ago
Wim 25cd1e2cc1
Refactor telegram handlers. Fix linting (#609)
* Refactor telegram handlers. Fix linting
6 years ago