class ClientEncrypted
extends ClientAbstract
Re-export
import { ClientEncrypted } from "https://deno.land/x/mtkruto@0.1.702/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 (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T): Promise<T extends functions.Function<unknown> ? T["__R"] : void>
invoke<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T, noWait: true): Promise<void>
invoke<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T, noWait?: boolean): Promise<T | void>
setAuthKey(key: Uint8Array)