Skip to content

sendChatAction

Sahri Riza Umami edited this page Jun 10, 2017 · 5 revisions

Sends notification about user activity in a chat.

sendChatAction(chat_id, action, progress)
Option Description
chat_id Chat identifier.
action Action description. The actions are Typing, Cancel, RecordVideo, UploadVideo, RecordVoice, UploadVoice, UploadPhoto, UploadDocument, GeoLocation, ChooseContact, and StartPlayGame.
progress Upload progress in percents.

Example

  • ser typing message.

    sendChatAction(1234567890, 'Typing')

    Response:

    {
      ID = "Ok"
    }
  • User cancels typing.

    sendChatAction(1234567890, 'Cancel')

    Response:

    {
      ID = "Ok"
    }
  • User records a video.

    sendChatAction(1234567890, 'RecordVideo')

    Response:

    {
      ID = "Ok"
    }
  • User uploads a video.

    sendChatAction(1234567890, 'UploadVideo', 100)

    Response:

    {
      ID = "Ok"
    }
  • User records voice message.

    sendChatAction(1234567890, 'RecordVoice')

    Response:

    {
      ID = "Ok"
    }
  • User uploads voice message.

    sendChatAction(1234567890, 'UploadVoice', 100)

    Response:

    {
      ID = "Ok"
    }
  • User uploads a photo.

    sendChatAction(1234567890, 'UploadPhoto', 100)

    Response:

    {
      ID = "Ok"
    }
  • User uploads a document.

    sendChatAction(1234567890, 'UploadDocument', 100)

    Response:

    {
      ID = "Ok"
    }
  • User sends geolocation.

    sendChatAction(1234567890, 'GeoLocation')

    Response:

    {
      ID = "Ok"
    }
  • User chooses contact to send.

    sendChatAction(1234567890, 'ChooseContact')

    Response:

    {
      ID = "Ok"
    }
  • User starts to play a game.

    sendChatAction(1234567890, 'StartPlayGame')

    Response:

    {
      ID = "Ok"
    }

Test script
Frequently Asked Questions
The Functions

Clone this wiki locally