summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/handlers.go
Commit message (Collapse)AuthorAgeFilesLines
* Add nil check for group update (telegram) (#2036)Joseph Mansy2023-04-051-7/+7
|
* Support telegram chat Join/Leave updates (#2019)Joseph Mansy2023-04-031-0/+46
| | | Co-authored-by: Wim <wim@42.be>
* Fix broken reply (telegram) (#2026)Thom Dickson2023-04-031-3/+3
| | | | | | | | | | | | | Fixes #2021 * Fix broken reply * Fix reply/quoting logic with topics * Update handlers.go --------- Co-authored-by: Wim <wim@42.be>
* Add support for Telegram topics (telegram) (#1942)Thom Dickson2023-03-141-8/+19
| | | | | | | | | | Topics are surfaced by appending /<topic-id> to the channel setting for the gateway. An example for the topic with ID of 16 would be: ``` [[gateway.inout]] account="telegram.mytelegram" channel="-100xxxxxxxxxx/16" ```
* Use AuthorSignature as a fallback username (telegram) (#1979)Joseph Mansy2023-03-091-2/+11
| | | | | This comes in handy for annoucement type channels where neither the SenderChat or From structs contain name information. Also Tweak username logic as when using a full name the username field can be " " instead of "".
* Fix telegram attachment comment formatting and escaping (#1920)Alexander2022-11-261-0/+5
|
* Fix error messages in telegram and slack bridges (#1862)Alexander2022-09-051-1/+1
| | | | | | | * Fix message html entities escaping when sending to Telegram * Fix error messages in telegram and slack bridges Co-authored-by: Wim <wim@42.be>
* Fix telegram message deletion request (#1818)Alexander2022-05-011-1/+1
|
* Do not apply any markup to URL entities (telegram) (#1808)ValdikSS2022-04-221-1/+6
| | | | | | | | | | | | | handleEntities code uses simple modification offset which does not allow to detect whether the offset is placed before or after the element in already modified string. This works fine is most cases as Telegram server always sort the elements by offset, in ascending order. However, this is not the case when the modification, for example bold text, is applied to the URL. In this case, the offset of URL and bold entity is equal, which raises the issue. This commit introduces additional hack for this case, stripping any entities which intersect with URL.
* Do not modify .webm files (telegram). Fixes #17** (#1802)Wim2022-04-171-1/+1
|
* Multiple media in one message (telegram) (#1779)Alexander2022-03-301-21/+35
| | | | | | | | | | | | | * Send multiple images/video/documents as media group * Fix media caption quotting * Fix errors handling * Refactor parent id detection * Try to reduce cognitive complexity of code * Remove unused conditional
* Preserve threading from telegram replies (telegram) (#1776)Alexander2022-03-251-0/+5
| | | | | | | * Preserve threading from telegram replies * Add fallback for unthreaded telegram message * Fix linter issue
* Add UseFullName option (telegram) (#1777)Alexander2022-03-251-0/+12
|
* Fix for complex-formatted Telegram text (#1765)ValdikSS2022-03-191-12/+16
| | | | | | | | | | | * 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
* Fix Telegram channel title in forwards (#1753)ValdikSS2022-03-121-0/+5
| | | | 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".
* Fix Telegram Problem (unforwarded formatting and skipping of linebreaks) (#1749)Jan Martin Reckel2022-03-121-1/+18
| | | | | | | | | | | | | * 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>
* Add support for sender_chat (telegram) (#1677)Wim2022-02-041-0/+24
| | | | | | | | | | * 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
* Add Telegram Bot Command /chatId (telegram) (#1703)Ivan Zuev2022-02-031-2/+15
| | | | | | | | * 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>
* Update telegram-bot-api to v5 (#1660)Wim2021-12-121-35/+41
|
* Fix telegram/handlers.go linting (#1658)Wim2021-12-101-5/+5
|
* Add support for code blocks in telegram (#1650)Dan Walmsley2021-12-071-0/+15
| | | | | | | | | | | * 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.
* Convert .tgs with go libraries (and cgo) (telegram) (#1569)Benau2021-08-241-14/+4
| | | | | | | | | | | | | | | | 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>
* Adding caption to send telegram images. Fixes #1357 (#1358)Paul2021-04-031-11/+22
| | | | | | | | | | | | | | | | | * 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>
* Check rune length instead of bytes (telegram). Fixes #1409 (#1412)Wim2021-02-251-8/+10
|
* Add jpe as valid image filename extension (telegram) (#1360)Paul2021-01-141-1/+1
|
* Rename .oga audio files to .ogg (telegram) (#1349)Wim2021-01-021-0/+5
|
* Support Telegram animated stickers (tgs) format (#1173)Ben Wiederhake2020-08-231-8/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix MarkdownV2 support in Telegram (#1169)Andrey Groshev2020-07-121-0/+3
|
* Fix forward from hidden users (telegram). Closes #1131 (#1143)Wim2020-05-231-13/+23
| | | | Use ForwardDate to check if a message is forwarded. If we have a nil ForwardedFrom then make this an unknown user.
* Make avatars download work with mediaserverdownload (telegram). Fixes #920 ↵Wim2020-02-151-1/+1
| | | | (#1012)
* Add QuoteLengthLimit option (telegram) fixes #963 (#985)Humorhenker2020-01-301-0/+8
| | | * QuoteLengthLimit option added to limit max. quoted message length if QuoteLengthLimit = 0 the whole message will be quoted
* Fix panic by checking slice bounds in handleEntities (telegram). Fixes #857 ↵Wim2019-07-081-3/+9
| | | | | | (#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
* Handle nil message (telegram). Fixes #777Wim2019-04-051-0/+5
|
* Revert "Bail if any vars are nil, not if all (telegram) (#778)"Wim2019-04-051-2/+2
| | | | This reverts commit efd2c9986270a8a1dd35f896a80d6465fc52054b.
* Bail if any vars are nil, not if all (telegram) (#778)David Hill2019-03-271-2/+2
|
* Add support for URL in messageEntities (telegram). Fixes #735 (#736)Wim2019-03-021-0/+22
|
* Add MediaConvertWebPToPNG option (telegram). (#741)Wim2019-02-271-0/+9
| | | | | | | | * 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
* Refactor telegram (#649)Wim2018-12-121-0/+44
| | | * Decrease complexity in Send() (makes codeclimate happy)
* Fix telegram crash #620Wim2018-11-291-2/+2
|
* Refactor telegram handlers. Fix linting (#609)Wim2018-11-281-0/+302
* Refactor telegram handlers. Fix linting