Skip to content

sendAnimation

Sahri Riza Umami edited this page Jun 12, 2018 · 5 revisions

Send an animation message.

sendAnimation(chat_id, reply_to_message_id, animation, caption, parse_mode, duration, width, height, thumbnail, thumb_width, thumb_height, disable_notification, from_background, reply_markup, callback, data)
Field Type Description
chat_id int53 Chat to send message.
reply_to_message_id int53 Identifier of a message to reply to.
animation inputFile Animation file to be sent. The file can be defined by its unique ids, remote ids, local path or generated by client.
caption string Animation caption; 0-200 characters.
parse_mode string Text parse mode.
thumbnail inputThumb Animation thumbnail, if available.
duration int32 Duration of the animation, in seconds.
width int32 Width of the animation; may be replaced by the server.
height int32 Height of the animation, may be replaced by the server
disable_notification Bool Pass true, to disable notification about the message, doesn't works in secret chats
from_background Bool Pass true, if the message is sent from background
reply_markup ReplyMarkup Bots only. Markup for replying to message

Example

  • Send an animation message by its unique ids which is 212, into chat 1234567890. Add "Test" string in bold as its caption.

    sendAnimation(1234567890, msg.id, 212, '<b>Test</b>', 'html')

    Response:

    {
      ["@type"] = "message",
      author_signature = "",
      can_be_deleted_for_all_users = true,
      can_be_deleted_only_for_self = false,
      can_be_edited = false,
      can_be_forwarded = true,
      chat_id = "1234567890",
      contains_unread_mention = false,
      content = {
        ["@type"] = "messageAnimation",
        animation = {
          ["@type"] = "animation",
          animation = {
            ["@type"] = "file",
            expected_size = 89906,
            id = 212,
            ["local"] = {
              ["@type"] = "localFile",
              can_be_deleted = false,
              can_be_downloaded = true,
              downloaded_prefix_size = 0,
              downloaded_size = 0,
              is_downloading_active = false,
              is_downloading_completed = false,
              path = ""
            },
            remote = {
              ["@type"] = "remoteFile",
              id = "CgADBAAD9oEAAu4cZAdMVj7qI9SY5gI",
              is_uploading_active = false,
              is_uploading_completed = true,
              uploaded_size = 89906
            },
            size = 89906
          },
          duration = 3,
          file_name = "giphy.mp4",
          height = 264,
          mime_type = "video/mp4",
          thumbnail = {
            ["@type"] = "photoSize",
            height = 49,
            photo = {
              ["@type"] = "file",
              expected_size = 1980,
              id = 5,
              ["local"] = {
                ["@type"] = "localFile",
                can_be_deleted = false,
                can_be_downloaded = true,
                downloaded_prefix_size = 0,
                downloaded_size = 0,
                is_downloading_active = false,
                is_downloading_completed = false,
                path = ""
              },
              remote = {
                ["@type"] = "remoteFile",
                id = "AAQEABP0WGEZAASV_ulEnlO8qN-yAAIC",
                is_uploading_active = false,
                is_uploading_completed = true,
                uploaded_size = 1980
              },
              size = 1980
            },
            type = "s",
            width = 90
          },
          width = 480
        },
        caption = {
          ["@type"] = "formattedText",
          entities = {
            {
              ["@type"] = "textEntity",
              length = 4,
              offset = 0,
              type = {
                ["@type"] = "textEntityTypeBold"
              }
            }
          },
          text = "Test"
        },
        is_secret = false
      },
      date = 1528823679,
      edit_date = 0,
      id = "15956181001",
      is_channel_post = false,
      is_outgoing = true,
      media_album_id = "0",
      reply_to_message_id = "15956180992",
      sender_user_id = 432106051,
      sending_state = {
        ["@type"] = "messageSendingStatePending"
      },
      ttl = 0,
      ttl_expires_in = 0,
      via_bot_user_id = 0,
      views = 0
    }  

Frequently Asked Questions
The Functions

Clone this wiki locally