channels.toggleSlowMode

Toggle supergroup slow mode: if enabled, users will only be able to send one message every seconds seconds

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.channels.toggleSlowMode({
        channel: new Api.InputChannel({...}),
        seconds: 9916814,
        }));
    console.log(result); // prints the result
})();

TL schema

seconds

Parameters

Name

Type

Description

seconds

Users will only be able to send one message every seconds seconds, 0 to disable the limitation

Result

Updates

Possible errors

Code

Type

Description

400

CHAT_ADMIN_REQUIRED

You must be an admin in this chat to do this

400

CHAT_NOT_MODIFIED

The pinned message wasn't modified

400

INPUT_METHOD_INVALID_1192227_X

Invalid method

400

INPUT_METHOD_INVALID_1604042050_X

Invalid method

400

SECONDS_INVALID

Invalid duration provided

Can bots use this methd ?

yes

How to handle channels, supergroups, groups, and what's the difference between them.

Last updated