messages.unpinAllMessages

Unpin all pinned messages

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.unpinAllMessages({
        peer: new Api.InputPeer({...}),
        }));
    console.log(result); // prints the result
})();

TL schema

messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;
---functions---
messages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory;

Parameters

Name

Type

Description

peer

Chat where to unpin

Result

messages.AffectedHistory

Possible errors

Code

Type

Description

Can bots use this methd ?

yes

Telegram allows pinning multiple messages on top of a specific chat.

Last updated