Skip to main content
Corvus Connection

IRewardsApi

Interface
TheOmenDen.StreamPulse.Scripting.IRewardsApiChannel-point reward mutation from a script (ctx.Twitch.Rewards, spec 071): edit a reward, toggle it, pause it, create it only if missing, and settle a pending redemption - all dispatching the same Mediator commands the Rewards page and the REST endpoints run.

Members

6
  • EnsureAsync
    method
    ValueTask<RewardResult> EnsureAsync(string title, int cost, string prompt = default, int? maxPerStream = default, int? maxPerUserPerStream = default, int? globalCooldownSeconds = default, CancellationToken cancellationToken = default)
    Creates a reward named title only if the app does not already own one by that name; otherwise returns the existing one. Idempotent, so it is safe on a recurring trigger.
  • FulfillAsync
    method
    ValueTask<RewardResult> FulfillAsync(string rewardId, string redemptionId, CancellationToken cancellationToken = default)
    Approves a pending redemption. The viewer keeps the points they spent.
  • RefundAsync
    method
    ValueTask<RewardResult> RefundAsync(string rewardId, string redemptionId, CancellationToken cancellationToken = default)
    Rejects a pending redemption; Twitch returns the viewer's points. Fails for a reward the app does not own, and for one that skips the request queue - those auto-fulfil and can never be refunded.
  • SetEnabledAsync
    method
    ValueTask<RewardResult> SetEnabledAsync(string rewardId, bool isEnabled, CancellationToken cancellationToken = default)
    Shows or hides the reward in the viewer's channel-point menu.
  • SetPausedAsync
    method
    ValueTask<RewardResult> SetPausedAsync(string rewardId, bool isPaused, CancellationToken cancellationToken = default)
    Pauses or resumes redemptions. A paused reward stays visible but cannot be redeemed - the usual way to close a queue mid-stream without the reward vanishing from the menu.
  • UpdateAsync
    method
    ValueTask<RewardResult> UpdateAsync(string rewardId, string title = default, int? cost = default, string prompt = default, string backgroundColor = default, CancellationToken cancellationToken = default)
    Edits a reward the app owns. Every optional argument left unset is untouched on Twitch, so this can change one field without restating the rest.