From cb0dcedfec8ddfa4aa04443ea92c20a7f12273cd Mon Sep 17 00:00:00 2001 From: XzbestX Date: Wed, 27 May 2026 10:34:06 +0900 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20CHANGELOG.md,?= =?UTF-8?q?=20start.bat,=20stop.bat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 271 +++++++++++++++++++++++++++++++++++++++++++++++++++ start.bat | 20 ++++ stop.bat | 12 +++ 3 files changed, 303 insertions(+) create mode 100644 CHANGELOG.md create mode 100644 start.bat create mode 100644 stop.bat diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d8553b0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,271 @@ +# Changelog + +Все значимые изменения проекта [MaxTelegramBridgeBot](https://github.com/BEARlogin/max-telegram-bridge-bot). + +--- + +## [v0.3.20] — 2026-05-13 +- Queue expire: notify crosspost owner DM, not the channel +- Веб хуки. Разделение для TG и Max + +## [v0.3.19] — 2026-05-08 +- Edit messages with media in MAX instead of sending new ones (TG→MAX) + +## [v0.3.18] — 2026-05-05 +- Forward MAX→TG: relay Link.Message content for repost messages + +## [v0.3.17] — 2026-04-30 +- Add DISABLE_PREFIX env + default OFF for chats not in pairs + +## [v0.3.16] — 2026-04-24 +- Fix: video-without-caption TG→MAX rejected as send-message.empty + +## [v0.3.15] — 2026-04-24 +- Route crosspost error notifications to owner DM, not to the channel + +## [v0.3.14] — 2026-04-24 +- Preserve links in TG→MAX crossposts; deliver text when video fails + +## [v0.3.13] — 2026-04-24 +- Add created_at to pairs for pair growth stats + +## [v0.3.12] — 2026-04-23 +- Simplify upload error hints — user-facing, no config details + +## [v0.3.11] — 2026-04-23 +- Surface TG→MAX upload errors in chat (not only in log) +- Document /thread_bridge and Part 1 reply routing in README + +## [v0.3.10] — 2026-04-23 +- Add /thread_bridge: link a single TG forum thread to a separate MAX chat + +## [v0.3.9] — 2026-04-23 +- Route MAX replies to source TG thread + crosspost/UX fixes +- Default prefix off, clarify admin requirement for TG forum groups +- Treat anonymous admins as admins for /bridge, /thread etc. + +## [v0.3.8] — 2026-04-20 +- Apply replacements in crosspost forwardTgToMax + +## [v0.3.7] — 2026-04-16 +- Fix release workflow: pass changelog via file to avoid shell expansion +- Очередь отправки (#34) +- Claude Code Review workflow +- Claude PR Assistant workflow +- Cache-bust favicon in README +- Revert README to plain links with logo and support link +- Redesign README with centered layout, badges and logo +- Add support/donate link to README + +## [v0.3.6] — 2026-04-08 +- Fix overlapping entities (bold+italic+strike) duplicating text + +## [v0.3.5] — 2026-04-08 +- Fix formatting in both TG→MAX and MAX→TG directions + +## [v0.3.4] — 2026-04-03 +- Edit messages with media in MAX instead of sending new ones (TG→MAX) + +## [v0.3.3] — 2026-04-03 +- **Fix:** Other bots' messages are now forwarded. Previously all bot messages were silently skipped. Now only the bridge bot itself is filtered — messages from any other bot in the group are forwarded normally. + +## [v0.3.2] — 2026-04-03 *(текущая локальная версия)* +- **New:** Sync edits toggle — new "✏️ Синк правок" button in crosspost management (both TG and MAX bots). When enabled, edits and deletes sync between linked channels respecting the direction setting. Disabled by default. + +## [v0.3.1] — 2026-04-02 +- **Fixes:** + - Caption formatting on photo/album crosspost — bold, italic, links and other formatting now preserved when crossposting photos and albums from TG to MAX + - Crosspost direction respected for edits — editing a post in MAX no longer updates the TG post when direction is set to TG→MAX only + - Delete sync disabled for crosspost channels — deleting a post in one channel no longer removes it from the linked channel (only works for regular bridge pairs) + +## [v0.3.0] — 2026-04-02 +- **Forum topics support:** Messages from MAX are delivered to the correct forum topic in TG groups +- `/thread` command — send it in a topic to route all MAX→TG messages there +- Send `/thread` in General to reset back to default +- Auto-reset when forum topics are disabled on the group +- **TG library migration:** Replaced `go-telegram-bot-api/v5` (2021) with `go-telegram/bot` v1.20.0 (Bot API 9.5) +- New `TGSender` adapter interface — library is fully isolated, easy to swap +- Proper error wrapping with HTTP status codes (403/400/404/429) +- All command responses go to the same topic they were sent from +- Strip @botname from commands in groups +- Auto-migrate TG chat ID when group upgrades to supergroup + +## [v0.2.4] — 2026-04-01 +- Fix video upload: must upload to CDN even when token is in endpoint +- Fix video download returning 0 bytes: LimitReader overflow +- Add text replacements info to /help in both TG and MAX bots + +## [v0.2.3] — 2026-03-29 +- Multiple fixes and updates across bridge.go, max.go, telegram.go, format.go, upload.go, queue.go +- Multiple README updates +- Release workflow improvements + +## [v0.2.1] — 2026-03-26 +- Fix file name lost when forwarding MAX→TG +- Add link to maxtelegrambridge.ru in README +- Update RouterOS.yml + +## [v0.2.0] — 2026-03-26 +- Add text replacements for crosspost channels +- Add developer section in README +- Add TG_API_URL to README and .env.example + +## [v0.1.2] — 2026-03-25 +- Fix crosspost channel albums: buffer media groups instead of sending individually +- Fix photo upload: use UploadPhotoFromReader for local TG API +- Fix photo upload for local TG Bot API: download and upload ourselves +- Implement editMessageMedia for MAX→TG media edits +- Fix nil pointer crashes, add video albums, harden ALLOWED_USERS +- Fix multi-image forwarding: send all attachments and group albums +- Add ALLOWED_USERS whitelist to restrict bridge and crosspost setup +- Add configurable log level via LOG_LEVEL env var +- Clarify crosspost instruction: forward to MAX bot DM +- Use HTML parse mode for copyable code blocks in bot messages +- Fix broken crosspost: remove Markdown parsing from bot messages +- Add copyable code blocks and bot links to bridge instructions +- README: update features, add media edit limitation note +- Handle edited messages with media: forward as new message +- Treat 'attachment.not.ready after retries' as permanent error in queue +- Download MAX media to bridge server before sending to TG +- Fix local Bot API file serving: correct URL path + nginx alias +- Support custom TG Bot API server (TG_API_URL env) +- Revert HTTP timeout to 60s — 15s too short for media uploads +- Fix MAX webhook: explicitly subscribe to message_created events +- Remove binary and db backup from repo +- Switch to webhook mode for instant message delivery +- Don't retry permanent errors (403/404) in send queue +- Add retry queue for MAX→TG direction +- Fix nil pointer crash: channel posts have no From field +- Add sticker forwarding MAX→TG +- Auto-create GitHub release on tag push with changelog +- Add GIF (Animation) and Sticker forwarding TG→MAX +- Add user/chat IDs to all log messages for debugging +- Log TG user ID on channel post forward for crosspost +- Track users, dual owner IDs for crosspost (TG + MAX) +- Soft delete for crossposts — track deleted_at and deleted_by +- Filter /crosspost list by owner — show only own links +- Add owner_id to crossposts, restrict management to owner +- Add support link to /start message +- Add retry queue for failed message delivery +- Add CC BY-NC 4.0 license + +## [v0.0.16] — 2026-03-25 +- Fix photo upload: use UploadPhotoFromReader for local TG API +- Fix photo upload for local TG Bot API: download and upload ourselves +- Implement editMessageMedia for MAX→TG media edits +- Fix nil pointer crashes, add video albums, harden ALLOWED_USERS +- Fix multi-image forwarding: send all attachments and group albums +- Add ALLOWED_USERS whitelist to restrict bridge and crosspost setup +- Add configurable log level via LOG_LEVEL env var +- Clarify crosspost instruction: forward to MAX bot DM +- Use HTML parse mode for copyable code blocks in bot messages +- Fix broken crosspost: remove Markdown parsing from bot messages +- Add copyable code blocks and bot links to bridge instructions +- README: update features, add media edit limitation note +- Handle edited messages with media: forward as new message +- Treat 'attachment.not.ready after retries' as permanent error in queue +- Download MAX media to bridge server before sending to TG +- Fix local Bot API file serving: correct URL path + nginx alias +- Support custom TG Bot API server (TG_API_URL env) +- Revert HTTP timeout to 60s — 15s too short for media uploads +- Fix MAX webhook: explicitly subscribe to message_created events +- Remove binary and db backup from repo + +## [v0.0.15] — 2026-03-24 +- Implement editMessageMedia for MAX→TG media edits +- Fix nil pointer crashes, add video albums, harden ALLOWED_USERS +- Fix multi-image forwarding: send all attachments and group albums +- Add ALLOWED_USERS whitelist to restrict bridge and crosspost setup +- Add configurable log level via LOG_LEVEL env var +- Clarify crosspost instruction: forward to MAX bot DM +- Use HTML parse mode for copyable code blocks in bot messages +- Fix broken crosspost: remove Markdown parsing from bot messages +- Add copyable code blocks and bot links to bridge instructions +- README: update features, add media edit limitation note +- Handle edited messages with media: forward as new message +- Treat 'attachment.not.ready after retries' as permanent error in queue +- Download MAX media to bridge server before sending to TG +- Fix local Bot API file serving: correct URL path + nginx alias +- Support custom TG Bot API server (TG_API_URL env) +- Revert HTTP timeout to 60s — 15s too short for media uploads +- Fix MAX webhook: explicitly subscribe to message_created events +- Remove binary and db backup from repo +- Switch to webhook mode for instant message delivery +- Don't retry permanent errors (403/404) in send queue + +## [v0.0.14] — 2026-03-21 +- README: update features, add media edit limitation note +- Handle edited messages with media: forward as new message +- Treat 'attachment.not.ready after retries' as permanent error in queue +- Download MAX media to bridge server before sending to TG +- Fix local Bot API file serving: correct URL path + nginx alias +- Support custom TG Bot API server (TG_API_URL env) +- Revert HTTP timeout to 60s — 15s too short for media uploads +- Fix MAX webhook: explicitly subscribe to message_created events +- Remove binary and db backup from repo +- Switch to webhook mode for instant message delivery +- Don't retry permanent errors (403/404) in send queue +- Add retry queue for MAX→TG direction +- Fix nil pointer crash: channel posts have no From field +- Add sticker forwarding MAX→TG +- Auto-create GitHub release on tag push with changelog +- Add GIF (Animation) and Sticker forwarding TG→MAX +- Add user/chat IDs to all log messages for debugging +- Log TG user ID on channel post forward for crosspost +- Track users, dual owner IDs for crosspost (TG + MAX) +- Soft delete for crossposts — track deleted_at and deleted_by + +## [v0.0.13] — 2026-03-20 +- Download MAX media to bridge server before sending to TG +- Fix local Bot API file serving: correct URL path + nginx alias +- Support custom TG Bot API server (TG_API_URL env) +- Revert HTTP timeout to 60s — 15s too short for media uploads +- Fix MAX webhook: explicitly subscribe to message_created events +- Remove binary and db backup from repo +- Switch to webhook mode for instant message delivery +- Don't retry permanent errors (403/404) in send queue +- Add retry queue for MAX→TG direction +- Fix nil pointer crash: channel posts have no From field +- Add sticker forwarding MAX→TG +- Auto-create GitHub release on tag push with changelog +- Add GIF (Animation) and Sticker forwarding TG→MAX +- Add user/chat IDs to all log messages for debugging +- Log TG user ID on channel post forward for crosspost +- Track users, dual owner IDs for crosspost (TG + MAX) +- Soft delete for crossposts — track deleted_at and deleted_by +- Filter /crosspost list by owner — show only own links +- Add owner_id to crossposts, restrict management to owner +- Add support link to /start message + +--- + +[v0.3.20]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.20 +[v0.3.19]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.19 +[v0.3.18]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.18 +[v0.3.17]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.17 +[v0.3.16]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.16 +[v0.3.15]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.15 +[v0.3.14]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.14 +[v0.3.13]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.13 +[v0.3.12]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.12 +[v0.3.11]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.11 +[v0.3.10]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.10 +[v0.3.9]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.9 +[v0.3.8]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.8 +[v0.3.7]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.7 +[v0.3.6]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.6 +[v0.3.5]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.5 +[v0.3.4]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.4 +[v0.3.3]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.3 +[v0.3.2]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.2 +[v0.3.1]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.1 +[v0.3.0]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.3.0 +[v0.2.4]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.2.4 +[v0.2.3]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.2.3 +[v0.2.1]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.2.1 +[v0.2.0]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.2.0 +[v0.1.2]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.1.2 +[v0.0.16]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.0.16 +[v0.0.15]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.0.15 +[v0.0.14]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.0.14 +[v0.0.13]: https://github.com/BEARlogin/max-telegram-bridge-bot/releases/tag/v0.0.13 diff --git a/start.bat b/start.bat new file mode 100644 index 0000000..b27fb18 --- /dev/null +++ b/start.bat @@ -0,0 +1,20 @@ +@echo off +chcp 65001 > nul +cd /d "%~dp0" + +echo [MAX Bridge Bot] Загрузка переменных из .env и запуск... +echo. + +powershell -Command ^ + Get-Content '.env' ^| ForEach-Object { ^ + $parts = $_ -split '=', 2; ^ + if ($parts.Count -eq 2) { ^ + Set-Item -Path \"env:$($parts[0].Trim())\" -Value $parts[1].Trim() ^ + } ^ + }; ^ + Write-Host '--- Bot started. Press Ctrl+C to stop ---'; ^ + go run . + +echo. +echo [MAX Bridge Bot] Бот остановлен. +pause diff --git a/stop.bat b/stop.bat new file mode 100644 index 0000000..ba637df --- /dev/null +++ b/stop.bat @@ -0,0 +1,12 @@ +@echo off +chcp 65001 > nul +cd /d "%~dp0" + +echo [MAX Bridge Bot] Остановка бота... +echo. + +taskkill /f /im bearlogin-bridge.exe > nul 2>&1 +taskkill /f /im go.exe > nul 2>&1 + +echo [MAX Bridge Bot] Бот остановлен. +pause