Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sendChatAction

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

Develop a 'Telegram Bot' with R

v2.4.0
GPL-3
Authors
Ernest Benedito [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.