Skip to content

Predictions

Vincent Lee edited this page Jul 26, 2021 · 2 revisions

IPL uses Twitch Predictions to help with view interaction on streams. Predictions allow viewers on Twitch to place channels points on one of 2 options and they may receive more points depending on the outcome of the prediction.

predictionStore

Schema

Assosiated Sub-schemas

Contains information on the last prediction that was requested from the Radia Production API. The fields stored are named the same and contain the values as what is documented by Twitch Developers for Get Prediction request's data[0] object.

Radia productions

ipl-overlay-controls Accesses the Twitch Predictions API Endpoints via Radia-Productions API that acts as a middle-man handling Twitch Authentication and Broadcaster ID details.

To use this feature, configure an API URL and authorization key from the bundle configuration (More info at the readme) and set the ID of the Discord server to import casters from through the "Settings" panel in the IPL Setup workspace. After setup is completed, the Predictions panel will show its functions if the Discord Guild is supported.

Currently, the code required in Radia-Productions API for this function is not publically accessible. If you would like access to this system you can contact vlee489#5801 via Discord for queries on access this section of Radia-Productions.

Code Examples

predictionStore

predictionStore.on('change', (newValue) => {
    console.log(`total channel points used: ${prediction.outcomes[0].channel_points + prediction.outcomes[1].channel_points}`);
});
Clone this wiki locally