class ClientEncrypted
extends ClientAbstract
Re-export
import { ClientEncrypted } from "https://deno.land/x/mtkruto@0.2.30/mod.ts";
An MTProto client for making encrypted connections. Most users won't need to interact with this. Used internally by Client
.
There are a few things to note:
- This is a bare client and it stores nothing.
- It expects an authorization key to be present before invoking any method.
- Authorization must be set using
setAuthKey
. - Incoming packets that aren't a reply to a specific call are passed to the assigned handlers.
- It doesn't uncompress compressed packets.
Constructors
new
ClientEncrypted(params?: ClientAbstractParams)Methods
connect(): Promise<void>
invoke<T extends Api.AnyObject<P>, P extends Api.Function, R extends unknown = Promise<T["_"] extends keyof Api.Functions ? Api.ReturnType<Api.Functions[T["_"]]> : never>>(function_: T, noWait?: boolean): Promise<R | void>
setAuthKey(key: Uint8Array)