TwitchLib 3.5.3
Loading...
Searching...
No Matches
TwitchLib.Api.Helix.Predictions Class Reference

Predictions related APIs More...

Inheritance diagram for TwitchLib.Api.Helix.Predictions:
TwitchLib.Api.Core.ApiBase

Public Member Functions

 Predictions (IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http)
 
Task< GetPredictionsResponseGetPredictionsAsync (string broadcasterId, List< string > ids=null, string after=null, int first=20, string accessToken=null)
 Get information about all Channel Points Predictions or specific Channel Points Predictions for a Twitch channel. More...
 
Task< CreatePredictionResponseCreatePredictionAsync (CreatePredictionRequest request, string accessToken=null)
 Create a Channel Points Prediction for a specific Twitch channel. More...
 
Task< EndPredictionResponseEndPredictionAsync (string broadcasterId, string id, PredictionEndStatus status, string winningOutcomeId=null, string accessToken=null)
 Lock, resolve, or cancel a Channel Points Prediction. More...
 
- Public Member Functions inherited from TwitchLib.Api.Core.ApiBase
 ApiBase (IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http)
 
async ValueTask< string > GetAccessTokenAsync (string accessToken=null)
 

Additional Inherited Members

- Protected Member Functions inherited from TwitchLib.Api.Core.ApiBase
async Task< string > TwitchGetAsync (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchGetGenericAsync< T > (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPatchGenericAsync< T > (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< string > TwitchPatchAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< KeyValuePair< int, string > > TwitchDeleteAsync (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPostGenericAsync< T > (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPostGenericModelAsync< T > (string resource, ApiVersion api, RequestModel model, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchDeleteGenericAsync< T > (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPutGenericAsync< T > (string resource, ApiVersion api, string payload=null, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< string > TwitchPutAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< KeyValuePair< int, string > > TwitchPostAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
Task PutBytesAsync (string url, byte[] payload)
 
async Task< T > GetGenericAsync< T > (string url, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, ApiVersion api=ApiVersion.Helix, string clientId=null)
 
- Protected Attributes inherited from TwitchLib.Api.Core.ApiBase
readonly IApiSettings Settings
 

Detailed Description

Predictions related APIs

Constructor & Destructor Documentation

◆ Predictions()

TwitchLib.Api.Helix.Predictions.Predictions ( IApiSettings  settings,
IRateLimiter  rateLimiter,
IHttpCallHandler  http 
)

Member Function Documentation

◆ CreatePredictionAsync()

Task< CreatePredictionResponse > TwitchLib.Api.Helix.Predictions.CreatePredictionAsync ( CreatePredictionRequest  request,
string  accessToken = null 
)

Create a Channel Points Prediction for a specific Twitch channel.

Required scope: channel:manage:predictions

Parameters
request
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ EndPredictionAsync()

Task< EndPredictionResponse > TwitchLib.Api.Helix.Predictions.EndPredictionAsync ( string  broadcasterId,
string  id,
PredictionEndStatus  status,
string  winningOutcomeId = null,
string  accessToken = null 
)

Lock, resolve, or cancel a Channel Points Prediction.

Active Predictions can be updated to be “locked,” “resolved,” or “canceled.”

Locked Predictions can be updated to be “resolved” or “canceled.”

Required scope: channel:manage:predictions

Parameters
broadcasterIdThe broadcaster running prediction events. Provided broadcaster_id must match the user_id in the user OAuth token.
idID of the Prediction to update/end.
statusThe Prediction status to be set. Valid values:

RESOLVED: A winning outcome has been chosen and the Channel Points have been distributed to the users who predicted the correct outcome.

CANCELED: The Prediction has been canceled and the Channel Points have been refunded to participants.

LOCKED: The Prediction has been locked and viewers can no longer make predictions.

Parameters
winningOutcomeIdID of the winning outcome for the Prediction.

This parameter is required if status is being set to RESOLVED.

Parameters
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetPredictionsAsync()

Task< GetPredictionsResponse > TwitchLib.Api.Helix.Predictions.GetPredictionsAsync ( string  broadcasterId,
List< string >  ids = null,
string  after = null,
int  first = 20,
string  accessToken = null 
)

Get information about all Channel Points Predictions or specific Channel Points Predictions for a Twitch channel.

Results are ordered by most recent, so it can be assumed that the currently active or locked Prediction will be the first item.

Required scope: channel:read:predictions

Parameters
broadcasterIdThe broadcaster running Predictions. Provided broadcaster_id must match the user_id in the user OAuth token.
idsIDs of Predictions.

Filters results to one or more specific Predictions.

Not providing one or more IDs will return the full list of Predictions for the authenticated channel.

Maximum: 100

Parameters
afterCursor for forward pagination: tells the server where to start fetching the next set of results in a multi-page response.
firstMaximum number of objects to return. Maximum: 20. Default: 20.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

The documentation for this class was generated from the following file: