GramJS

help.GetConfig

Returns current configuration, including data center configuration.

Example

const { Api, TelegramClient } = require("telegram");
const { StringSession } = require("telegram/sessions");

const session = new StringSession(""); // You should put your string session here
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
  await client.connect(); // This assumes you have already authenticated with .start()

  const result = await client.invoke(new Api.help.GetConfig({}));
  console.log(result); // prints the result
})();
import { Api, TelegramClient } from "telegram";
import { StringSession } from "telegram/sessions";

const session = new StringSession(""); // You should put your string session here
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
  await client.connect(); // This assumes you have already authenticated with .start()

  const result: Api.Config = await client.invoke(new Api.help.GetConfig({}));
  console.log(result); // prints the result
})();

Parameters

NameTypeDescription

Result

Config

Possible errors

CodeTypeDescription
400CONNECTION_API_ID_INVALIDThe provided API id is invalid
400CONNECTION_APP_VERSION_EMPTYApp version is empty
400CONNECTION_DEVICE_MODEL_EMPTYDevice model empty
400CONNECTION_LANG_PACK_INVALIDLanguage pack invalid
400CONNECTION_LAYER_INVALIDLayer invalid
400CONNECTION_NOT_INITEDConnection not initialized
400CONNECTION_SYSTEM_EMPTYConnection system empty
400CONNECTION_SYSTEM_LANG_CODE_EMPTYThe system_lang_code field is empty
400DATA_INVALIDEncrypted data invalid
400INPUT_LAYER_INVALIDThe provided layer is invalid
400MSG_ID_INVALIDInvalid message ID provided

Can bots use this method?

Yes