-
Notifications
You must be signed in to change notification settings - Fork 188
Releases: gotd/td
v0.156.3
a8dd8b8 What's Changed
Full Changelog: v0.156.2...v0.156.3
Assets 2
v0.156.2
406a51b What's Changed
Full Changelog: v0.156.1...v0.156.2
Assets 2
v0.156.1
dd45993 What's Changed
Full Changelog: v0.156.0...v0.156.1
Assets 2
v0.156.0
429a09d What's Changed
- docs(examples): add runnable examples for helper packages by @ernado in #1773
- feat(telegram): make MTProto usage indistinguishable from Telegram Desktop by @ernado in #1774
Full Changelog: v0.155.0...v0.156.0
Assets 2
v0.155.0
6138c4a What's Changed
- feat(gen): derive mappings with caller-supplied parameters by @ernado in #1771
- fix(telegram): use permanent key only for CDN connections by @pylakey in #1772
Full Changelog: v0.154.0...v0.154.1
Assets 2
v0.154.0
6ac0462 Highlights
This release replaces the hard dependency on go.uber.org/zap
with the minimal, dependency-free github.com/gotd/log logging
port across all packages. This is a breaking change for any code that sets Logger on
telegram.Options (or any other gotd option struct that exposes a logger).
Why
zap leaked into the core dependency graph of every gotd consumer. gotd/log is a two-method
port (Enabled/Log) with no third-party dependencies; the concrete backend is chosen by the
consumer through a separate adapter module, so the backend's dependency never enters the core
graph. Levels match log/slog and scalar attributes avoid boxing on hot paths.
Migrating your loggers
The Logger fields changed type from *zap.Logger to github.com/gotd/log.Logger. Pick the
migration path that matches the logger you already use.
Keeping zap (smallest change)
Wrap your existing *zap.Logger with the logzap adapter:
import ( "go.uber.org/zap" "github.com/gotd/log/logzap" "github.com/gotd/td/telegram" ) zapLog, _ := zap.NewProduction() client := telegram.NewClient(appID, appHash, telegram.Options{ Logger: logzap.New(zapLog), // was: Logger: zapLog })
Add the adapter module to your build:
go get github.com/gotd/log/logzap@latestUsing the standard library log/slog (no extra deps beyond stdlib)
import ( "log/slog" "github.com/gotd/log/logslog" "github.com/gotd/td/telegram" ) client := telegram.NewClient(appID, appHash, telegram.Options{ Logger: logslog.New(slog.Default()), })
Other backends
Drop-in adapter modules ship for the common loggers — import only the one you use, and its
dependency stays out of your core graph:
| Backend | Adapter module |
|---|---|
go.uber.org/zap |
github.com/gotd/log/logzap |
stdlib log/slog |
github.com/gotd/log/logslog |
github.com/rs/zerolog |
github.com/gotd/log/logzerolog |
github.com/sirupsen/logrus |
github.com/gotd/log/loglogrus |
No logger at all
If you previously passed zap.NewNop() (or nothing), no change is required — nil now defaults
to log.Nop, which discards every record. You can also pass log.Nop explicitly:
import "github.com/gotd/log" telegram.Options{Logger: log.Nop}
Writing your own log call sites
If your application logged through the same *zap.Logger you handed to gotd, you can keep using
zap directly — the migration only affects the value you pass into gotd options. If you want to log
against the gotd/log port itself, use the Helper for ergonomic call sites:
import "github.com/gotd/log" h := log.For(l) // log.For(nil) is a no-op Helper h.Info(ctx, "connected", log.String("dc", dc))
What's Changed
Full Changelog: v0.153.0...v0.154.0
Assets 2
v0.153.0
e1eca1e What's Changed
- chore(deps): bump golang.org/x/tools from 0.45.0 to 0.46.0 in /_tools in the golang group by @dependabot[bot] in #1768
- chore(deps): bump golang.org/x/tools from 0.45.0 to 0.46.0 in the golang group by @dependabot[bot] in #1767
- Update Telegram schema to the latest layer by @gotd-bot[bot] in #1769
Full Changelog: v0.152.0...v0.153.0
Assets 2
v0.152.0
218bea0 What's Changed
- feat(auth): safer 2FA password handling via protected memory (memguard) by @ernado in #1758
- feat(message): add sticker source helpers to send stickers by @ernado in #1759
- feat(faketls): generate browser-like ClientHello via uTLS by @ernado in #1760
- feat(peers): add channel/supergroup admin helpers by @ernado in #1761
- feat(peers): add channel recommendations helper by @ernado in #1762
- ci(coverage): run on self-hosted ubuntu runner by @ernado in #1763
- fix(calls): drain ICE notifier goroutines on Conn.Close by @ernado in #1764
- feat(tgtest): add personal-messages service by @ernado in #1765
- feat(message): add rich message builder and parsers by @ernado in #1766
Full Changelog: v0.151.0...v0.152.0
Assets 2
v0.151.0
ad595a7 What's Changed
- feat(message): link preview options (InvertMedia, WebPage builder) by @ernado in #1744
- feat(query): add GetMediaGroup helper for albums by @ernado in #1745
- feat(message): expose Spoiler option on media builders by @ernado in #1743
- feat(auth): add password recovery helpers by @ernado in #1746
- feat(clock): add NTP-calibrated network clock by @ernado in #1747
- feat(updates): add state-load failure callbacks by @ernado in #1748
- fix(telegram): retry requests on new connection after connection loss by @ernado in #1749
- feat(telegram): add connection state hook by @ernado in #1750
- feat(uploader): compute part size automatically for large files by @ernado in #1751
- feat(query): add GetMessages by-id helper by @ernado in #1752
- fix(tdesktop): prefer modern key_datas file over legacy 0/1 by @ernado in #1754
- feat(calls): 1:1 and group voice/video calls by @ernado in #1755
- chore(deps): bump golang.org/x/net from 0.55.0 to 0.56.0 in the golang group by @dependabot[bot] in #1756
Full Changelog: v0.150.0...v0.151.0
Assets 2
v0.150.0
2ceafb7 What's Changed
- feat(updates): force getDifference for updates referencing peers with unknown access hash by @pylakey in #1738
New Contributors
Full Changelog: v0.149.0...v0.150.0