create

suspend fun create(broadcasterId: String, title: String, outcomes: List<String>, predictionWindow: Int): Prediction

Twitch API: Create Prediction

Creates a Channel Points Prediction. With a Channel Points Prediction, the broadcaster poses a question and viewers try to predict the outcome. The prediction runs as soon as it's created. The broadcaster may run only one prediction at a time.

Return

the created prediction.

Parameters

broadcasterId

the ID of the broadcaster that's running the prediction. This ID must match the user ID in the user access token.

title

the question that the broadcaster is asking. For example, Will I finish this entire pizza? The title is limited to a maximum of 45 characters.

outcomes

the list of possible outcomes that the viewers may choose from. The list must contain a minimum of 2 choices and up to a maximum of 10 choices.

predictionWindow

the length of time (in seconds) that the prediction will run for. The minimum is 30 seconds and the maximum is 1800 seconds (30 minutes).