Changes
- Updated the TL schema to layer 227
- RPC errors are now strongly typed — every Telegram RPC error is generated as its own class from the official error database, so you can
catchspecific errors viainstanceof(e.g.errors.SessionRevokedError,errors.AuthKeyUnregisteredError,errors.ChannelPrivateError). Unknown or newer errors fall back to the base class for their HTTP code (e.g.UnauthorizedError,FloodError), anderror.errorMessagealways carries the exact server string for string matching - Fixed a long-standing crash where
start()on an unauthorized or revoked session threwTypeError: Cannot use 'in' operator to search for 'phoneNumber' in undefinedinstead of a real error — it now surfaces the actual auth error (anUnauthorizedErrorsuch asSessionRevokedError/AuthKeyUnregisteredError/UserDeactivatedError). Auth params tostart()are now optional - Frozen-account errors are now mapped by their HTTP code; the previous
FrozenError/FrozenMethodError/FrozenParticipantErrorremain as deprecated aliases, so existingcatchcode keeps working
Upgrade
- Run: npm i teleproto@latest