---
sidebar_position: 10
description: Send poll and other functions to work with Telegram in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Telegram]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Send poll
 Sends a poll with answer options



`Function SendPoll(Val Token, Val ChatID, Val Question, Val AnswersArray, Val Anonymous = True) Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Bot token |
  | ChatID | --chat | String, Number | &#x2714; | Target chat ID or ChatID*TopicID |
  | Question | --question | String | &#x2714; | Poll question |
  | AnswersArray | --options | Array of String | &#x2714; | Array of answer options |
  | Anonymous | --anonymous | Boolean | &#x2716; | Survey anonymity flag |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Telegram

:::tip
Method at API documentation: [sendPoll](https://core.telegram.org/bots/api#sendpoll)
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    Token     = "6129457865:AAFyzNYOAFbu...";
    ChatID    = "461699897";
    ChannelID = "@testsichee";
    Question  = "What's your favorite color?";

    AnswersArray = New Array;
    AnswersArray.Add("Red");
    AnswersArray.Add("Yellow");
    AnswersArray.Add("Green");
    AnswersArray.Add("Blue");

    Result = OPI_Telegram.SendPoll(Token, ChatID, Question, AnswersArray, False);

    Result = OPI_Telegram.SendPoll(Token, ChannelID, Question, AnswersArray, True);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint telegram SendPoll \
             --token "***" \
             --chat "***" \
             --question "What's your favorite color?" \
             --options "['Red','Yellow','Green','Blue']" \
             --anonymous true
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint telegram SendPoll ^
             --token "***" ^
             --chat "***" ^
             --question "What's your favorite color?" ^
             --options "['Red','Yellow','Green','Blue']" ^
             --anonymous true
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "ok": true,
 "result": {
  "message_id": 18415,
  "from": {
   "id": 6129457865,
   "is_bot": true,
   "first_name": "Бот Виталий",
   "username": "sicheebot"
  },
  "chat": {
   "id": 461699897,
   "first_name": "Anton",
   "last_name": "Titovets",
   "username": "bayselonarrend",
   "type": "private"
  },
  "date": 1765390547,
  "poll": {
   "id": "5316759437560518421",
   "question": "What's your favorite color?",
   "options": [
    {
     "text": "Red",
     "voter_count": 0
    },
    {
     "text": "Yellow",
     "voter_count": 0
    },
    {
     "text": "Green",
     "voter_count": 0
    },
    {
     "text": "Blue",
     "voter_count": 0
    }
   ],
   "total_voter_count": 0,
   "is_closed": false,
   "is_anonymous": false,
   "type": "regular",
   "allows_multiple_answers": false
  }
 }
}
```
