messages.setTyping

Sends a current user typing event (see SendMessageActionarrow-up-right for all event types) to a conversation partner or group.

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

TL schema

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;

Parameters

Parameter added in Layer 17arrow-up-right.|

Result

Boolarrow-up-right

Possible errors

Code

Type

Description

400

CHANNEL_INVALID

The provided channel is invalid

400

CHANNEL_PRIVATE

You haven't joined this channel/supergroup

400

CHAT_ADMIN_REQUIRED

You must be an admin in this chat to do this

400

CHAT_ID_INVALID

The provided chat id is invalid

403

CHAT_WRITE_FORBIDDEN

You can't write in this chat

400

INPUT_USER_DEACTIVATED

The specified user was deleted

400

MSG_ID_INVALID

Invalid message ID provided

400

PEER_ID_INVALID

The provided peer id is invalid

400

USER_BANNED_IN_CHANNEL

You're banned from sending messages in supergroups/channels

400

USER_IS_BLOCKED

You were blocked by this user

400

USER_IS_BOT

Bots can't send messages to other bots

Can bots use this methd ?

yes

Telegram allows commenting on a channel postarrow-up-right or on a generic supergroup messagearrow-up-right, thanks to message threads.

Below you will find information on scheme changes. For more details on the use of layers, see Invoking API methodsarrow-up-right.

User actions. Use this to provide users with detailed info about their chat partners' actions: typing or sending attachments of all kinds.

Last updated

Was this helpful?