max-telegram-bridge-bot/addon_stub.go
Andrey Lugovskoy 9a5f187caf
Some checks are pending
Build / build (push) Waiting to run
Add generic optional-addon extension point
Introduces a minimal Addon interface (Start, HandleDMCommand,
HandleDMForward) wired into the bridge:

- bridge.go: Bridge gains an addon field, started as a goroutine in Run
  when non-nil; loadAddon is provided per build configuration.
- addon_stub.go (default build, //go:build !addon): loadAddon returns
  nil — the public binary has no addon and no extra behavior.
- telegram.go: private-chat messages and channel forwards are offered to
  the addon first when present; if it handles them, the bridge skips its
  own processing. No-op in the public build.
- TGSender.ForwardMessage(from, to, msgID, silent) added — a generic Bot
  API wrapper returning the full message; useful for any addon that needs
  to relay existing messages.

The concrete addon implementation is compiled separately via the `addon`
build tag and is not part of this repository.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-18 01:57:30 +04:00

6 lines
178 B
Go

//go:build !addon
package main
// loadAddon — публичная сборка: расширения не подключены.
func loadAddon(b *Bridge) Addon { return nil }