Methods

invoke

Invoke a low-level function.

Type Parameters

<T extends Api.AnyFunction | Mtproto.ping, R = T extends Mtproto.ping ? Mtproto.pong : T extends Api.AnyGenericFunction<infer X> ? Api.ReturnType<X> : T["_"] extends keyof Api.Functions ? Api.ReturnType<T> extends never ? Api.ReturnType<Api.Functions[T["_"]]> : never : never>

Parameters

function_: T

The function to invoke.

dc?: DC
type?: "download" | "upload"

Result

R

Syntax

// Required parameters only.
await client.invoke(function_);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.invoke(function_, { dc, type });