Skip to content

getChat

Sahri Riza Umami edited this page Jun 22, 2018 · 6 revisions

Returns information about a chat by its identifier, this is an offline request if the current user is not a bot.

getChat(chat_id)
Field Type Description
chat_id int53 Chat identifier

Example

  • Get information about chat -1001234567890.

    getChat(-1001234567890)

    Response:

    {
      ["@type"] = "chat",
      can_be_reported = true,
      client_data = "",
      id = "-1001234567890",
      is_pinned = true,
      last_message = {
        ["@type"] = "message",
        author_signature = "",
        can_be_deleted_for_all_users = true,
        can_be_deleted_only_for_self = false,
        can_be_edited = true,
        can_be_forwarded = true,
        chat_id = "-1001234567890",
        contains_unread_mention = false,
        content = {
          ["@type"] = "messageText",
          text = {
            ["@type"] = "formattedText",
            entities = {
              {
                ["@type"] = "textEntity",
                length = 5,
                offset = 0,
                type = {
                  ["@type"] = "textEntityTypeBotCommand"
                }
              }
            },
            text = "/pang"
          }
        },
        date = 1529675850,
        edit_date = 0,
        id = "16082010112",
        is_channel_post = false,
        is_outgoing = true,
        media_album_id = "0",
        reply_to_message_id = 0,
        sender_user_id = 24904272,
        ttl = 0,
        ttl_expires_in = 0,
        via_bot_user_id = 0,
        views = 0
      },
      last_read_inbox_message_id = "16082010112",
      last_read_outbox_message_id = "16079912960",
      notification_settings = {
        ["@type"] = "notificationSettings",
        mute_for = 617807796,
        show_preview = true,
        sound = "default"
      },
      order = "0",
      photo = {
        ["@type"] = "chatPhoto",
        big = {
          ["@type"] = "file",
          expected_size = 0,
          id = 18,
          ["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 = "AQADBQATaRLMMgAES5f-JJ_5sW30-gMAAQI",
            is_uploading_active = false,
            is_uploading_completed = true,
            uploaded_size = 0
          },
          size = 0
        },
        small = {
          ["@type"] = "file",
          expected_size = 0,
          id = 17,
          ["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 = "AQADBQATaRLMMgAESFh36L2q-QTy-gMAAQI",
            is_uploading_active = false,
            is_uploading_completed = true,
            uploaded_size = 0
          },
          size = 0
        }
      },
      reply_markup_message_id = 0,
      title = "Supergroup PlayGround",
      type = {
        ["@type"] = "chatTypeSupergroup",
        is_channel = false,
        supergroup_id = 1234567890
      },
      unread_count = 0,
      unread_mention_count = 0
    }  

Frequently Asked Questions
The Functions

Clone this wiki locally