messages.getChats
Returns chat basic info on their IDs.
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.messages.getChats({
        id: [5105918],
        }));
    console.log(result); // prints the result
})();import {Api, TelegramClient} from 'telegram';
import {StringSession} from 'telegram/sessions';
const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});
(async function run() {
    const result: Api.messages.Chats = await client.invoke(new Api.messages.getChats({
        id: [5105918],
        }));
    console.log(result); // prints the result
})();TL schema
messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
messages.chatsSlice#9cd81144 count:int chats:Vector<Chat> = messages.Chats;
---functions---
messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;Parameters
Result
Possible errors
Code
Type
Description
400
CHAT_ID_INVALID
The provided chat id is invalid
400
PEER_ID_INVALID
The provided peer id is invalid
Can bots use this methd ?
yes
Related pages
Last updated
Was this helpful?