Commit Graph
19 Commits
Author SHA1 Message Date
esef 89bf238b0e test #2 2026-09-09 11:26:27 +03:00
esef 0b5ba6511e better compression for GIFs 2026-09-09 10:19:09 +03:00
esefandClaude Opus 5 eac6dbda3a tgbridge: rework both directions — avatars, stickers, replies, edits
fixes that were dropping messages:
- d->tg sent parse_mode=Markdown with an unescaped body, so any message
  with a stray * _ ` or [ got a 400 from telegram and vanished. now html
  with proper escaping + a plain-text retry
- no allowed_mentions on webhook posts, so telegram could @everyone
- forwarder.start() ran from on_ready, which fires again on every gateway
  reconnect -> second poller on the same token -> 409s and dupes
- document.mime_type is nullable and was called directly
- sticker finally block hit UnboundLocalError when mkstemp raised
- ffmpeg timeouts leaked temp files and orphaned the process

stickers, per format instead of one blanket gif convert:
- static .webp now passes through (the gif convert crushed 228 alpha
  levels to 2 and made the file 4x bigger)
- video .webm -> animated webp, keeps 8-bit alpha, ~7x smaller than gif.
  needs -c:v libvpx-vp9 before -i or ffmpeg silently drops the alpha
- .tgs is gzipped lottie, ffmpeg exits 183 on it and we were uploading
  the raw file. renders via optional lottie lib, else thumbnail + emoji

added: telegram profile photos as webhook avatars (re-hosted in a private
channel, AVATAR_CACHE_CHANNEL_ID), reply threading both ways, edit sync
both ways, delete sync d->tg, album batching, voice/poll/location/contact/
dice/forward attribution, utf-16-safe entity conversion, mention and custom
emoji resolution, message splitting instead of truncation, shared aiohttp
session with 429 backoff, route discovery from env, !bridge status

main.py just loads the extension now; routes come from credentials.env

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RXrxDFpyq3VjvxWGuW3CZe
2026-09-07 12:19:18 +03:00
esef 7d754367ae add timeouts to tg download, fix ffprobe tempfile leak 2026-07-18 13:57:29 +03:00
esef 5e69d316db forwarder polish 2026-07-18 13:53:58 +03:00
esef c2133705fe trimmed down music.py 2026-07-09 17:40:23 +03:00
esef d1d07a3c3b debug emojis removed 2026-07-05 15:52:10 +03:00
esef 8c36a139a8 polishing discord to telegram forwarder 2026-06-29 15:36:39 +03:00
esef 793311b1e2 polished forwarding 2026-06-29 15:32:44 +03:00
esef 0358baa522 sticker to gif conversion 2026-06-23 19:47:38 +03:00
esef 92b004c668 implement the same thing for stickers 2026-06-23 19:42:39 +03:00
esef 0aeaf60e86 telegram gif fix 2026-06-23 19:35:44 +03:00
esef 4a3e1b7029 telegram gif fix #4 2026-06-23 19:30:57 +03:00
esef 206ddf893e telegram gif fix #3 2026-06-23 19:26:15 +03:00
esef 4358df8da9 telegram gif fix 2 2026-06-23 19:11:34 +03:00
esef 4ca7e13246 telegram gif issue fixed 2026-06-23 19:01:59 +03:00
esef 0db51f9336 Completely disable !help and add second Telegram route 2026-06-23 18:47:21 +03:00
esef 16e9b54a76 twitter forward feature 2026-06-22 22:36:26 +03:00
esef 2b26984698 telegram forwarding method added 2026-06-22 21:59:29 +03:00