Firebot icon indicating copy to clipboard operation
Firebot copied to clipboard

Add Prediction Variables (Parity with Polls)

Open GrandpaCelery opened this issue 3 months ago • 0 comments

Polls let me easily get each choice's title and votes. I would love for predictions to also allow that too.

The main differences are:

  • Poll choices can have up to 5 options, while prediction outcomes can go up to 10.
  • Predictions also include a top_predictors array for each outcome (up to 10 users), showing details about the biggest bettors:
    Each top_predictors item has:
    • user_name, user_login, user_id (I don't think we really care about user_login and user_name both) ~~personally I'm not look for ID but eh~~
    • channel_points_used
    • channel_points_won

For example I just copied how polls work and adapted/added for predictions:


Polls Variable & Example phrasing Predictions Variable & Example phrasing
$pollTitle $predictionTitle
Title of the Twitch poll, or "Unknown" if unavailable. Title of the Twitch prediction, or "Unknown" if unavailable.
$pollChoices $predictionOutcomes
Array of poll choices—each has index, title, and or possibly points/votes. Array of prediction outcomes—each has index, name, color, a votes object (with channel_points and user_count), and a top_predictors array (up to 10 users).
$pollChoices[count] $predictionOutcomes[count]
Number of choices in the poll, or -1 if missing. Number of outcomes in the prediction (up to 10), or -1 if missing.
$pollChoices[title, votes] $predictionOutcomes[title, votes]
Array of poll choice titles, sorted by votes (most to least), or "Unknown". Array of outcome titles, sorted by channel points bet (or possibly user count), or "Unknown". Each has votes with both counts.
$pollChoices[votes, index, 1] $predictionOutcomes[votes, index, 1]
Votes for the first poll choice, or -1. Votes for the first prediction outcome (channel_points and user_count), or -1.
$predictionOutcomes[top_predictors, index, 1]
Array of top predictors for outcome 1, each with user_name, user_login, user_id, channel_points_used, and channel_points_won.
$pollChoices[points, null, 4] $predictionOutcomes[votes, null, 4]
Channel point votes for poll choice 4, or -1. Votes for outcome 4 (channel_points and user_count), or -1.
$predictionOutcomes[top_predictors, null, 4]
Array of top predictors for outcome 4.
$pollChoices[index, votes, null] $predictionOutcomes[index, votes, null]
Array of poll choice indices, sorted by votes. Array of prediction outcome indices, sorted by channel points or possibly user count.
$pollChoices[raw, index, 2] $predictionOutcomes[raw, index, 2]
Object for the second poll choice, or null. Object for the second prediction outcome (with votes and top_predictors), or null.
$pollWinningChoiceName $predictionWinningOutcomeName
Name(s) of winning poll choice(s). Name of the winning prediction outcome.
$pollWinningChoiceVotes $predictionWinningOutcomeVotes
Number of votes for the winning poll choice. Votes object for the winning prediction outcome (channel_points and user_count).
$predictionWinningOutcomeTopPredictors
Array of top predictors for the winning prediction outcome.

Twitch Docs: https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelpredictionbegin

GrandpaCelery avatar Sep 21 '25 18:09 GrandpaCelery