TwitchGetRewardUserCounter

Returns reward count of the given reward for a specified Twitch user

Signature

public TwitchRewardCounter TwitchGetRewardUserCounter(string userLogin, string rewardId, bool persisted = true)

Parameters

userLogin
string required

No description provided.

rewardId
string required

Id of your reward. Available by right-clicking your reward under Platforms > Twitch > Channel Point Rewards

persisted
bool
Default:
True

No description provided.

Return Type

Streamer.bot.Plugin.Interface.Model.TwitchRewardCounter

Example

using System;
public class CPHInline
{
    public bool Execute()
    {
        //Define reward id of reward you want counter
        string rewardId = "4fcc2d13-9bcf-4c18-9d91-821a15f4b6e5";
        //Get user login
        CPH.TryGetArg("userName",out string userLogin);
        //Get persisted reward counter info of for specific user
        TwitchRewardCounter rewardCounter = CPH.TwitchGetRewardUserCounter(userLogin, rewardId, true);         //Get counter
        int counter = rewardCounter.Count;
        //Set Argumnet for counter
        CPH.SetArgument("rewardUserCounter", counter);
        return true;
    }
}