createPoll

Creates a Twitch poll in the specified channel.

Note: Must be called from inside a Fiber.

version(TwitchSupport && WithTwitchPlugin)
package
createPoll
(,
const string channelName
,
const string title
,
const string durationString
,
const string[] choices
,
const string caller = __FUNCTION__
)

Parameters

plugin TwitchPlugin

The current TwitchPlugin.

channelName string

Name of channel to create the poll in.

title string

Poll title.

durationString string

How long the poll should run for in seconds (as a string).

choices string[]

A string array of poll choices.

caller string

Name of the calling function.

Return Value

Type: auto

An array of JSONValues with the response returned when creating the poll. On failure, an empty JSONValue is instead returned.

Throws

UnexpectedJSONException on unexpected JSON. EmptyDataJSONException if the JSON has a "data" key but it is empty.