Skip to content

Add Twitch action to resolve a prediction #606

Description

@verbatimt

Requested by a user: allow mods to resolve a Twitch prediction from chat (e.g. !prediction to start, !good / !bad to resolve), since the Twitch mobile mod UI makes this painful.

Current state

TwitchActionType only exposes CreatePrediction. There is no resolve/lock/cancel action. The Create Prediction action can only react to a resolution: it polls until status == RESOLVED, then exposes $predictionoutcome and runs its sub-actions. The resolve itself must still be done in Twitch's UI.

There is also no workaround via the Web Request action. Twitch resolves predictions with PATCH /helix/predictions, and HttpMethodEnum only supports GET/POST/PUT/DELETE.

Already in place

  • PredictionsService.EndPrediction(broadcaster, id, outcomeID) (MixItUp.Base/Services/Twitch/API/PredictionsService.cs:54) already PATCHes status: "RESOLVED" + winning_outcome_id. Nothing calls it.
  • The channel:manage:predictions scope is already requested (MixItUp.Base/Services/Twitch/New/TwitchSession.cs:42).

Missing

  • ResolvePrediction action type (MixItUp.Base/Model/Actions/TwitchActionModel.cs), plus LockPrediction / CancelPrediction if we want the full set.
  • An EndPrediction wrapper on the service layer. Neither TwitchPlatformService nor New/TwitchService exposes it.
  • Editor UI in TwitchActionEditorControl.xaml to pick the winning outcome.
  • A way to target the active prediction. There is no $predictionid special identifier, so either cache the ID from the Create Prediction action or GET the most recent prediction and resolve that. The latter also covers predictions started from the Twitch UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    STAT: Pending TriageRequired team review to determine viability and level of effort.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions