sendChatAction: Send a chat action

View source: R/bot.R

sendChatActionR Documentation

Send a chat action

Description

Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).

Usage

sendChatAction(chat_id, action)

Arguments

chat_id

Unique identifier for the target chat or username of the target channel.

action

Type of action to broadcast. Choose one, depending on what the user is about to receive:

  • typing for text messages

  • upload_photo for photos

  • upload_video for videos

  • record_video for video recording

  • upload_audio for audio files

  • record_audio for audio file recording

  • upload_document for general files

  • find_location for location data

  • upload_video_note for video notes

  • record_video_note for video note recording

Details

You can also use it's snake_case equivalent send_chat_action.

Examples

## Not run: 
bot <- Bot(token = bot_token("RTelegramBot"))
chat_id <- user_id("Me")

bot$sendChatAction(
  chat_id = chat_id,
  action = "typing"
)

## End(Not run)

telegram.bot documentation built on Sept. 7, 2022, 5:07 p.m.