poll := send_poll(Args{
channel_id: trigger.channel_id,
question: "What is your favorite color?",
answers: func() {
poll_answer(Args{text: "Option A"})
},
})
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Message ID: " + poll.message_id,
})
Inputs
Channel IDRequired
ID of the channel to send the poll in.
QuestionRequired
The poll question (max 300 characters).
Example: What is your favorite color?
AnswersRequired
Poll answer options (1–10).
Holds blocks: Poll Answer
Duration (hours)
How long the poll lasts in hours (1–768). Defaults to 24.
Example: 24
Allow Multiselect
Whether users can pick multiple answers.
Optionsfalsetrue
Outputs
Message ID
ID of the sent poll message.
Build a bot using blocks like Send Poll
Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.
Advanced Documentation
This documentation can be useful when using code mode. View as Markdown
ID:
send_pollInputs
| Field | InventScript name | Value |
|---|---|---|
| Channel ID | channel_id | |
| Question | question | e.g. "What is your favorite color?" |
| Answers | answers | blocks: func() { ... } with only poll_answer* blocks |
| Duration (hours) | duration | e.g. "24" |
| Allow Multiselect | allow_multiselect | "false", "true" |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Message ID | message_id |
Example InventScript
More messages blocks
Send or Edit Text MessageSend or Edit a text-only messageSend TTS MessageSend a text-to-speech message.Send Advanced MessageSend a Components v2 message.Send or Edit Embed MessageSend or edit an embed message.Get MessageFetch a single message by its ID from a channel.Get MessagesFetch recent messages from a channel and iterate over them.Search Server MessagesSearch a server's messages and iterate over the matched messages.Get Pinned MessagesFetch pinned messages from a channel and iterate over them.Forward MessageForward a message into another channel.Delete MessageDelete a message by its ID from a channel.Pin MessagePin a message in a channel.Unpin MessageUnpin a message in a channel.Publish MessagePublish an announcement message to all channels following the announcement channel.Suppress Message EmbedsSuppresses link preview embeds on a message by setting the SUPPRESS_EMBEDS flag.Purge MessagesBulk-delete messages from a channel.Poll AnswerA single answer option for a poll.End PollImmediately end a poll on a message.Get Poll Answer VotersFetch users who voted for a specific poll answer and iterate over them.