Skip to content

getStorageStatistics

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

Returns storage usage statistics.

getStorageStatistics(chat_limit)
Field Type Description
chat_limit int32 Maximum number of chats with the largest storage usage for which separate statistics should be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0.

Example

  • Get storage usage statistics from 2 chats.

    getStorageStatistics(2)

    Response

    {
      ["@type"] = "storageStatistics",
      by_chat = {
        {
          ["@type"] = "storageStatisticsByChat",
          by_file_type = {
            {
              ["@type"] = "storageStatisticsByFileType",
              count = 1,
              file_type = {
                ["@type"] = "fileTypeThumbnail"
              },
              size = 1971
            },
            {
              ["@type"] = "storageStatisticsByFileType",
              count = 168,
              file_type = {
                ["@type"] = "fileTypePhoto"
              },
              size = 204885
            }
          },
          chat_id = -15387310,
          count = 169,
          size = 206856
        },
        {
          ["@type"] = "storageStatisticsByChat",
          by_file_type = {
            {
              ["@type"] = "storageStatisticsByFileType",
              count = 7,
              file_type = {
                ["@type"] = "fileTypePhoto"
              },
              size = 7250
            }
          },
          chat_id = "-1001011121314",
          count = 7,
          size = 7250
        },
        {
          ["@type"] = "storageStatisticsByChat",
          by_file_type = {
            {
              ["@type"] = "storageStatisticsByFileType",
              count = 13,
              file_type = {
                ["@type"] = "fileTypePhoto"
              },
              size = 15709
            }
          },
          chat_id = 0,
          count = 13,
          size = 15709
        }
      },
      count = 189,
      size = 229815
    }

Frequently Asked Questions
The Functions

Clone this wiki locally