help.getCountriesList

Get name, ISO code, localized name and phone codes/patterns of all available countries

Example

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

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result = await client.invoke(new Api.help.getCountriesList({
        langCode: 'random string here',
        hash: 9454367,
        }));
    console.log(result); // prints the result
})();

TL schema

help.countriesListNotModified#93cc1f32 = help.CountriesList;
help.countriesList#87d0759e countries:Vector<help.Country> hash:int = help.CountriesList;
---functions---
help.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;

Parameters

Name

Type

Description

lang_code

Language code of the current user

hash

Result

help.CountriesList

Possible errors

Code

Type

Description

Can bots use this methd ?

yes

How to fetch results from large lists of objects.

Last updated