Interface ITelegramClient
Properties
Readonly
stopSignal
stopSignal: AbortSignal
Methods
call
- call<T>(message, params?): Promise<RpcCallReturn[T["_"]]>
Returns Promise<RpcCallReturn[T["_"]]>
changePrimaryDc
- changePrimaryDc(newDc): Promise<void>
Returns Promise<void>
close
- close(): Promise<void>
Returns Promise<void>
computeNewPasswordHash
- computeNewPasswordHash(algo, password): Promise<Uint8Array>
Returns Promise<Uint8Array>
connect
- connect(): Promise<void>
Returns Promise<void>
emitError
- emitError(err): void
Returns void
exportSession
- exportSession(): Promise<string>
Returns Promise<string>
getApiCrenetials
- getApiCrenetials(): Promise<{
hash: string;
id: number;
}> Returns Promise<{
hash: string;
id: number;
}>
getMtprotoMessageId
- getMtprotoMessageId(): Promise<Long>
Returns Promise<Long>
getPoolSize
- getPoolSize(kind, dcId?): Promise<number>
Returns Promise<number>
getPrimaryDcId
- getPrimaryDcId(): Promise<number>
Returns Promise<number>
handleClientUpdate
- handleClientUpdate(updates, noDispatch?): void
Returns void
importSession
- importSession(session, force?): Promise<void>
Returns Promise<void>
notifyChannelClosed
- notifyChannelClosed(channelId): Promise<boolean>
Returns Promise<boolean>
notifyChannelOpened
- notifyChannelOpened(channelId, pts?): Promise<boolean>
Parameters
- channelId: number
Optional
pts: number
Returns Promise<boolean>
notifyLoggedOut
- notifyLoggedOut(): Promise<void>
Returns Promise<void>
onConnectionState
- onConnectionState(handler): void
Returns void
onError
- onError(handler): void
Parameters
- handler: ((err: unknown) => void)
Returns void
onServerUpdate
- onServerUpdate(handler): void
Returns void
onUpdate
- onUpdate(handler): void
Returns void
prepare
- prepare(): Promise<void>
Returns Promise<void>
startUpdatesLoop
- startUpdatesLoop(): Promise<void>
Returns Promise<void>
stopUpdatesLoop
- stopUpdatesLoop(): Promise<void>
Returns Promise<void>