GramJS

help.GetCdnConfig

Get configuration for CDN file downloads.

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.GetCdnConfig({}));
  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.CdnConfig = await client.invoke(
    new Api.help.GetCdnConfig({})
  );
  console.log(result); // prints the result
})();

Parameters

NameTypeDescription

Result

CdnConfig

Possible errors

CodeTypeDescription
401AUTH_KEY_PERM_EMPTYThe temporary auth key must be binded to the permanent auth key to use these methods.

Can bots use this method?

Yes

Encrypted CDNs for Speed and Security