Get Poll Answer Voters

LoopMessages

Fetch users who voted for a specific poll answer and iterate over them.

  • Loop block: the blocks placed inside it run once for each item, and can use the current item's outputs.

Inputs

Channel IDRequired

ID of the channel containing the poll message.

Message IDRequired

ID of the poll message.

Answer IDRequired

ID of the answer to get voters for.

Example: 1

Loop Body

Blocks to run for each voter.

Holds blocks

Outputs

Iteration Number

Current iteration (1-based).

Example: 1

Total Iterations

Total number of voters.

Example: 10

User ID

ID of the voter.

Example: 123456789012345678

Username

Username of the voter.

Global Name

Display name of the voter.

Avatar URL

Avatar URL of the voter.

Is Bot

Whether the voter is a bot.

Example: false

Build a bot using blocks like Get Poll Answer Voters

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: get_poll_answer_voters
  • Loop block: write for item := range get_poll_answer_voters(Args{...}) { ... } and read the current item's outputs from item. See loops.

Inputs

FieldInventScript nameValue
Channel IDchannel_id
Message IDmessage_id
Answer IDanswer_ide.g. "1"
Loop Bodybodyblocks: func() { ... }

Outputs

FieldInventScript nameValue
Iteration Numberiteration_numbere.g. "1"
Total Iterationstotal_iterationse.g. "10"
User IDuser_ide.g. "123456789012345678"
Usernameusername
Global Nameglobal_name
Avatar URLavatar_url
Is Botis_bote.g. "false"

Example InventScript

for pollAnswerVoter := range get_poll_answer_voters(Args{
	channel_id: trigger.channel_id,
	message_id: trigger.message_id,
	answer_id:  1,
}) {
	send_text_message(Args{
		channel_id:      trigger.channel_id,
		message_content: "User ID: " + pollAnswerVoter.user_id,
	})
}

More messages blocks