Send Poll

BlockMessages

Send a poll message in a channel.

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_poll

Inputs

FieldInventScript nameValue
Channel IDchannel_id
Questionquestione.g. "What is your favorite color?"
Answersanswersblocks: func() { ... } with only poll_answer* blocks
Duration (hours)duratione.g. "24"
Allow Multiselectallow_multiselect"false", "true"

Outputs

FieldInventScript nameValue
Message IDmessage_id

Example InventScript

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,
})

More messages blocks