teleflutter library
Classes
- AbridgedPacketCodec
- Packet codec for the TCP Abridged transport mode.
- AES
- Provides AES IGE (Infinite Garble Extension) mode encryption and decryption, as required by Telegram's MTProto protocol.
- Authenticator
- Performs the MTProto authentication key exchange.
- AuthKey
- Holds the authorization key data and computes the auxiliary hash and key ID from the SHA-1 digest of the key.
- BinaryReader
- BinaryWriter
- BoolFalse
- BoolTrue
- BufferedReader
- A buffered byte reader that accumulates data from a socket stream and allows reading exact byte counts asynchronously.
- CallbackQuery
- CallbackQueryEvent
- ChatAction
- ChatActionEvent
- Connection
- Base class for all MTProto transport connections on native platforms.
- ConnectionTcpAbridged
- TCP Abridged transport connection.
- ConnectionTcpFull
- TCP Full transport connection.
- ConnectionTcpIntermediate
- TCP Intermediate transport connection.
- Event
- EventBuilder
- Factorization
- Provides fast factorization of large integers using Pollard's Rho algorithm with Brent's improvement.
- FullPacketCodec
- Packet codec for the TCP Full transport mode.
- GzipPacked
- IntermediatePacketCodec
- Packet codec for the TCP Intermediate transport mode.
- MemorySession
- A non-persistent, in-memory implementation of Session.
- MessageContainer
- MessageDeleted
- MessageDeletedEvent
- MessageEdited
- MessageEditedEvent
- MessageEntityBold
- MessageEntityCode
- MessageEntityItalic
- MessageEntityPre
- MessageEntityStrike
- MessageEntityTextUrl
- MTProtoPlainSender
- Sends and receives unencrypted MTProto messages.
- MTProtoSender
- The primary class for sending and receiving encrypted MTProto messages.
- MTProtoState
- Manages the encryption state for an MTProto session.
- NewMessage
- NewMessageEvent
- PacketCodec
- Abstraction for encoding and decoding MTProto transport packets.
- Raw
- RawEvent
- ReqDHParamsRequest
- TL request for req_DH_params (constructor 0xd712e4be).
- ReqPqMultiRequest
- TL request for req_pq_multi (constructor 0xbe7e8ef1).
- RequestState
- Holds all information about a request that has been queued or sent but not yet resolved.
- RpcErrorObj
- RpcResult
- RSA
- Provides RSA encryption using Telegram's server public keys.
- Session
- Abstract base class representing a Telegram session.
- SetClientDHParamsRequest
- TL request for set_client_DH_params (constructor 0xf5045f1f).
- StringSession
- TelegramClient
- A Telegram MTProto client that handles authentication, messaging, and updates.
- TLMessage
- TLObject
- TLObjectRegistry
- TLRequest
- TLVector
-
TotalList<
T> - UpdateState
- Holds the update sequence state for a Telegram entity.
Constants
- defaultDcId → const int
- defaultIpv4Ip → const String
- defaultIpv6Ip → const String
- defaultPort → const int
- maxConsecutiveIgnored → const int
- Maximum consecutive ignored messages before raising a security error.
- maxRecentMsgIds → const int
- Maximum number of recent remote message IDs to track for deduplication.
- msgTooNewDelta → const int
- How far into the future (seconds) a server message ID can be before it is considered suspicious.
- msgTooOldDelta → const int
- How far into the past (seconds) a server message ID can be before it is considered too old.
Properties
-
coreObjects
→ Map<
int, TLObjectFactory> -
final
Functions
-
addSurrogate(
String text) → String -
crc32(
Uint8List data) → int -
Computes the CRC32 checksum of
datausing the standard IEEE polynomial. -
delSurrogate(
String text) → String -
generateKeyDataFromNonce(
BigInt serverNonce, BigInt newNonce) → (Uint8List, Uint8List) -
generateRandomLong(
{bool signed = true}) → int -
getByteArray(
BigInt integer) → Uint8List -
parseHtml(
String html) → (String, List< TLObject> ) -
parseMarkdown(
String message) → (String, List< TLObject> ) -
rpcMessageToError(
int errorCode, String errorMessage, {int? requestId}) → RpcError - Converts an RPC error code and message into the appropriate RpcError subclass.
-
unparseHtml(
String text, List< TLObject> entities) → String -
unparseMarkdown(
String text, List< TLObject> entities) → String
Typedefs
-
AsyncEventFilter
= Future<
bool> Function(Event event) - ConnectionFactory = Connection Function(String ip, int port, int dcId)
- Factory function that creates a Connection for a given DC.
- EventFilter = bool Function(Event event)
- TLObjectFactory = TLObject Function(BinaryReader reader)
Exceptions / Errors
- AuthKeyNotFound
- Thrown when the server does not recognize the current authorization key.
- BadMessageError
- Thrown when the server reports a bad message error with a specific error code.
- BufferError
- ConnectionException
- Exception thrown when a network connection fails or is closed unexpectedly.
- FileMigrateError
- Thrown when the file is stored on a different DC (dcId).
- FloodWaitError
- Thrown when the server imposes a flood wait (rate limit) of seconds seconds.
- InvalidBufferError
- Thrown when the server sends a response with an invalid or unexpected buffer.
- InvalidChecksumError
- Thrown when a packet's CRC32 checksum does not match the expected value.
- NetworkMigrateError
- Thrown when the network requires migration to a different DC (dcId).
- PasswordHashInvalidError
- Thrown when the provided 2FA password hash is invalid.
- PhoneCodeInvalidError
- Thrown when the provided phone verification code is incorrect.
- PhoneMigrateError
- Thrown when the phone number belongs to a different DC (dcId).
- RpcError
- Thrown when the Telegram server returns an RPC error response.
- SecurityError
- Thrown when a cryptographic or authentication security check fails.
- TeleFlutterError
- Base class for all TeleFlutter exceptions.
- TypeNotFoundError
- Thrown when a TL constructor ID has no registered deserialization handler.
- UserMigrateError
- Thrown when the user account is located on a different DC (dcId).