TwitchApi.Predictions.CreatePrediction (TwitchApi v0.1.0) View Source
⛔ This module is autogenerated please do not modify manually.
Example request from twitch api docs:
descriptions:
Creates a Prediction for the TwitchDev channel.
requests:
curl -X POST 'https://api.twitch.tv/helix/predictions'
-H'Authorization: Bearer cfabdegwdoklmawdzdo98xt2fo512y'
-H'Client-Id: uo6dggojyb8d6soh92zknwmi5ej1q2'
-H'Content-Type: application/json'
-d'{
"broadcaster_id": "141981764",
"title": "Any leeks in the stream?",
"outcomes": [
{
"title": "Yes, give it time."
},
{
"title": "Definitely not."
}], "prediction_window": 120, }'
Example response from twitch api docs:
descriptions:
responses:
{"data":[{"id":"bc637af0-7766-4525-9308-4112f4cbf178","broadcaster_id":"141981764","broadcaster_name":"TwitchDev","broadcaster_login":"twitchdev","title":"Any leeks in the stream?","winning_outcome_id":null,"outcomes":[{"id":"73085848-a94d-4040-9d21-2cb7a89374b7","title":"Yes, give it time.","users":0,"channel_points":0,"top_predictors":null,"color":"BLUE"},{"id":"906b70ba-1f12-47ea-9e95-e5f93d20e9cc","title":"Definitely not.","users":0,"channel_points":0,"top_predictors":null,"color":"PINK"}],"prediction_window":120,"status":"ACTIVE","created_at":"2021-04-28T17:11:22.595914172Z","ended_at":null,"locked_at":null}]}
Link to this section Summary
Functions
Description:
NEW Create a Channel Points Prediction for a specific Twitch channel.
Link to this section Types
Specs
Link to this section Functions
Specs
call(
%{
broadcaster_id: String.t(),
outcomes: [map()],
prediction_window: integer(),
title: String.t()
}
| nil,
user_info()
) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}
Description:
NEW Create a Channel Points Prediction for a specific Twitch channel.
Required authentication:
Required authorization:
User OAuth tokenRequired scope: channel:manage:predictions