TwitchLib 3.5.3
|
Predictions related APIs More...
Public Member Functions | |
Predictions (IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) | |
Task< GetPredictionsResponse > | 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. More... | |
Task< CreatePredictionResponse > | CreatePredictionAsync (CreatePredictionRequest request, string accessToken=null) |
Create a Channel Points Prediction for a specific Twitch channel. More... | |
Task< EndPredictionResponse > | EndPredictionAsync (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 |
Predictions related APIs
TwitchLib.Api.Helix.Predictions.Predictions | ( | IApiSettings | settings, |
IRateLimiter | rateLimiter, | ||
IHttpCallHandler | http | ||
) |
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
request | |
accessToken | optional access token to override the use of the stored one in the TwitchAPI instance |
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
broadcasterId | The broadcaster running prediction events. Provided broadcaster_id must match the user_id in the user OAuth token. |
id | ID of the Prediction to update/end. |
status | The 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.
winningOutcomeId | ID of the winning outcome for the Prediction. |
This parameter is required if status is being set to RESOLVED.
accessToken | optional access token to override the use of the stored one in the TwitchAPI instance |
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
broadcasterId | The broadcaster running Predictions. Provided broadcaster_id must match the user_id in the user OAuth token. |
ids | IDs 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
after | Cursor for forward pagination: tells the server where to start fetching the next set of results in a multi-page response. |
first | Maximum number of objects to return. Maximum: 20. Default: 20. |
accessToken | optional access token to override the use of the stored one in the TwitchAPI instance |