Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/mtkruto/client/5_client.ts>ClientParams

Cross-runtime JavaScript library for building Telegram clients
Latest
interface ClientParams
implements ClientPlainParams
import { type ClientParams } from "https://deno.land/x/mtkruto@0.2.24/client/5_client.ts";

Properties

optional
storage: Storage

The storage provider to use. Defaults to memory storage. Passing a string constructs a memory storage with the string being the auth string.

optional
apiId: number

App's API ID from my.telegram.org/apps. Required if no account was previously authorized.

optional
apiHash: string

App's API hash from my.telegram.org/apps. Required if no account was previously authorized.

optional
parseMode: ParseMode

A parse mode to use when the parseMode parameter is not specified when sending or editing messages. Defaults to ParseMode.None.

optional
appVersion: string

The app_version parameter to be passed to initConnection. It is recommended that this parameter is changed if users are authorized. Defaults to MTKruto.

optional
deviceModel: string

The device_version parameter to be passed to initConnection. The default varies by the current runtime.

optional
langCode: string

The lang_code parameter to be passed to initConnection. Defaults to the runtime's language or "en".

optional
langPack: string

The lang_pack parameter to be passed to initConnection. Defaults to an empty string.

optional
systemLangCode: string

The system_lang_cde parameter to be passed to initConnection. Defaults to the runtime's language or "en".

optional
systemVersion: string

The system_version parameter to be passed to initConnection. The default varies by the current runtime.

optional
defaultHandlers: boolean

Whether to use default handlers. Defaults to true.

optional
ignoreOutgoing: boolean

Whether to ignore outgoing messages. Defaults to true for bots, and false for users.

optional
prefixes: string | string[]

Default command prefixes. Defaults to "/" for bots and "\" for users. This option must be set separately for nested composers.

optional
guaranteeUpdateDelivery: boolean

Whether to guarantee that order-sensitive updates are delivered at least once before delivering next ones. Useful mainly for clients providing a user interface à la Telegram Desktop. Defaults to false.

optional
dropPendingUpdates: boolean

Whether to not handle updates received when the client was not running. Defaults to true for bots, and false for users.

optional
persistCache: boolean

Whether to persist cache to the provided storage, and not memory. Defaults to false.

Explicitly setting this option to true is highly recommended if:

  • User accounts are authorized.
  • Less memory usage is demanded.
  • The client does not usually have a large uptime.

When the provided storage takes advantage of memory, nothing changes, even if set to true.