Poll Class

extends Base

Contains information about a poll

Properties

  • allowsMultipleAnswers: boolean
  • client: Client
  • closeDate: Date
  • correctOptionId: number
  • explanation: string
  • explanationEntities:
  • id: string
  • isAnonymous: boolean
  • isClosed: boolean
  • openPeriod: number
  • options:
  • question: string
  • totalVoterCount: number
  • type: PollType

Methods

{
  "id": 1737,
  "name": "Poll",
  "variant": "declaration",
  "kind": 128,
  "flags": {},
  "comment": {
    "summary": [
      {
        "kind": "text",
        "text": "Contains information about a poll"
      }
    ]
  },
  "children": [
    {
      "id": 1738,
      "name": "constructor",
      "variant": "declaration",
      "kind": 512,
      "flags": {},
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 55,
          "character": 1
        }
      ],
      "signatures": [
        {
          "id": 1739,
          "name": "new Poll",
          "variant": "signature",
          "kind": 16384,
          "flags": {},
          "sources": [
            {
              "fileName": "packages/tgkit/src/structures/Poll.ts",
              "line": 55,
              "character": 1
            }
          ],
          "parameters": [
            {
              "id": 1740,
              "name": "client",
              "variant": "param",
              "kind": 32768,
              "flags": {},
              "type": {
                "type": "reference",
                "target": 1,
                "name": "Client",
                "package": "tgkit",
                "qualifiedName": "default"
              }
            },
            {
              "id": 1741,
              "name": "data",
              "variant": "param",
              "kind": 32768,
              "flags": {},
              "type": {
                "type": "intrinsic",
                "name": "any"
              }
            }
          ],
          "type": {
            "type": "reference",
            "target": 1737,
            "name": "Poll",
            "package": "tgkit",
            "qualifiedName": "default"
          },
          "overwrites": {
            "type": "reference",
            "target": -1,
            "name": "Base.constructor"
          }
        }
      ],
      "overwrites": {
        "type": "reference",
        "target": -1,
        "name": "Base.constructor"
      }
    },
    {
      "id": 1749,
      "name": "allowsMultipleAnswers",
      "variant": "declaration",
      "kind": 1024,
      "flags": {},
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "*true*, if the poll allows multiple answers"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 32,
          "character": 1
        }
      ],
      "type": {
        "type": "intrinsic",
        "name": "boolean"
      }
    },
    {
      "id": 1755,
      "name": "client",
      "variant": "declaration",
      "kind": 1024,
      "flags": {
        "isInherited": true
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Base.ts",
          "line": 4,
          "character": 1
        }
      ],
      "type": {
        "type": "reference",
        "target": 1,
        "name": "Client",
        "package": "tgkit",
        "qualifiedName": "default"
      },
      "inheritedFrom": {
        "type": "reference",
        "target": -1,
        "name": "Base.client"
      }
    },
    {
      "id": 1754,
      "name": "closeDate",
      "variant": "declaration",
      "kind": 1024,
      "flags": {
        "isOptional": true
      },
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "Point in time when the poll will be automatically closed"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 53,
          "character": 1
        }
      ],
      "type": {
        "type": "reference",
        "target": {
          "sourceFileName": "node_modules/.pnpm/typescript@5.5.3/node_modules/typescript/lib/lib.es5.d.ts",
          "qualifiedName": "Date"
        },
        "name": "Date",
        "package": "typescript"
      }
    },
    {
      "id": 1750,
      "name": "correctOptionId",
      "variant": "declaration",
      "kind": 1024,
      "flags": {
        "isOptional": true
      },
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "0-based identifier of the correct answer option. Available only for polls in the quiz mode,\nwhich are closed, or was sent (not forwarded) by the bot or to the private chat with the bot."
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 38,
          "character": 1
        }
      ],
      "type": {
        "type": "intrinsic",
        "name": "number"
      }
    },
    {
      "id": 1751,
      "name": "explanation",
      "variant": "declaration",
      "kind": 1024,
      "flags": {
        "isOptional": true
      },
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "Text that is shown when a user chooses an incorrect answer or taps\non the lamp icon in a quiz-style poll, 0-200 characters"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 44,
          "character": 1
        }
      ],
      "type": {
        "type": "intrinsic",
        "name": "string"
      }
    },
    {
      "id": 1752,
      "name": "explanationEntities",
      "variant": "declaration",
      "kind": 1024,
      "flags": {
        "isOptional": true
      },
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 47,
          "character": 1
        }
      ],
      "type": {
        "type": "array",
        "elementType": {
          "type": "reference",
          "target": 1625,
          "name": "MessageEntity",
          "package": "tgkit",
          "qualifiedName": "default"
        }
      }
    },
    {
      "id": 1742,
      "name": "id",
      "variant": "declaration",
      "kind": 1024,
      "flags": {},
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "Unique poll identifier"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 11,
          "character": 1
        }
      ],
      "type": {
        "type": "intrinsic",
        "name": "string"
      }
    },
    {
      "id": 1747,
      "name": "isAnonymous",
      "variant": "declaration",
      "kind": 1024,
      "flags": {},
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "*true*, if the poll is anonymous"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 26,
          "character": 1
        }
      ],
      "type": {
        "type": "intrinsic",
        "name": "boolean"
      }
    },
    {
      "id": 1746,
      "name": "isClosed",
      "variant": "declaration",
      "kind": 1024,
      "flags": {},
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "*true*, if the poll is closed"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 23,
          "character": 1
        }
      ],
      "type": {
        "type": "intrinsic",
        "name": "boolean"
      }
    },
    {
      "id": 1753,
      "name": "openPeriod",
      "variant": "declaration",
      "kind": 1024,
      "flags": {
        "isOptional": true
      },
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "Amount of time in seconds the poll will be active after creation"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 50,
          "character": 1
        }
      ],
      "type": {
        "type": "intrinsic",
        "name": "number"
      }
    },
    {
      "id": 1744,
      "name": "options",
      "variant": "declaration",
      "kind": 1024,
      "flags": {},
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "List of poll options"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 17,
          "character": 1
        }
      ],
      "type": {
        "type": "array",
        "elementType": {
          "type": "reference",
          "target": 1765,
          "name": "PollOption",
          "package": "tgkit",
          "qualifiedName": "default"
        }
      }
    },
    {
      "id": 1743,
      "name": "question",
      "variant": "declaration",
      "kind": 1024,
      "flags": {},
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "Poll question"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 14,
          "character": 1
        }
      ],
      "type": {
        "type": "intrinsic",
        "name": "string"
      }
    },
    {
      "id": 1745,
      "name": "totalVoterCount",
      "variant": "declaration",
      "kind": 1024,
      "flags": {},
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "Total number of users that voted in the poll"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 20,
          "character": 1
        }
      ],
      "type": {
        "type": "intrinsic",
        "name": "number"
      }
    },
    {
      "id": 1748,
      "name": "type",
      "variant": "declaration",
      "kind": 1024,
      "flags": {},
      "comment": {
        "summary": [
          {
            "kind": "text",
            "text": "Poll type"
          }
        ]
      },
      "sources": [
        {
          "fileName": "packages/tgkit/src/structures/Poll.ts",
          "line": 29,
          "character": 1
        }
      ],
      "type": {
        "type": "reference",
        "target": 2056,
        "name": "PollType",
        "package": "tgkit"
      }
    }
  ],
  "groups": [
    {
      "title": "Constructors",
      "children": [
        1738
      ]
    },
    {
      "title": "Properties",
      "children": [
        1749,
        1755,
        1754,
        1750,
        1751,
        1752,
        1742,
        1747,
        1746,
        1753,
        1744,
        1743,
        1745,
        1748
      ]
    }
  ],
  "sources": [
    {
      "fileName": "packages/tgkit/src/structures/Poll.ts",
      "line": 9,
      "character": 21
    }
  ],
  "extendedTypes": [
    {
      "type": "reference",
      "target": {
        "sourceFileName": "packages/tgkit/src/structures/Base.ts",
        "qualifiedName": "default"
      },
      "name": "default",
      "package": "tgkit"
    }
  ]
}