github sanyok12345/teleproto v1.227.2

latest releases: v1.234.0, v1.233.0, v1.232.1...
4 months ago

Changes

  • Typed API facade: call any MTProto method as client.api.messages.sendMessage({...}), with full types for params and results. Method docs from core.telegram.org show up as JSDoc right in the IDE.
  • Entity cache rewritten: compact records, LRU eviction, optional TTL, bounded by default (4096 peers per segment). Tune with entityCache: true | false | { max, ttl }, inspect via client.entityCache.
  • Async sessions: processEntities may return a Promise, so custom sessions can live on Redis or any external store. Storage errors are logged and never fail the request.
  • Required TL fields are validated before serialization, with a clear error instead of broken payloads.
  • getButtons() resolves the inline bot through cache, session and network instead of cache only.

Fixes

  • A rotated access_hash now replaces the stale cached one (#17).
  • HTML tg://user?id=… mentions are sent as inputMessageEntityMentionName and stay clickable; unresolvable ones are kept, not dropped (#19).
  • Invite links with + are no longer stripped from sent messages.
  • A rejected async session.getInputEntity no longer breaks entity resolution.

Upgrade

  • Run: npm i teleproto@latest
  • The cache is now bounded by default; pass entityCache: {} for the old unbounded behavior.

Don't miss a new teleproto release

NewReleases is sending notifications on new releases.