public List<UserVariableValue<T>> GetTwitchUsersVar<T>(string varName, bool persisted = true)
The string name of the global variable
True
To get, set, or unset persisted global variables, set to true or leave empty.
To get, set, or unset temporary/non-persisted global variables, set to false.
List<UserVariableValue<T>>
using System;
using System.Collections.Generic; //Needed cause of List<> usage
public class CPHInline
{
public bool Execute()
{
//Get the user var list which is a List of type UserVariableValue with a specific type
List<UserVariableValue<long>> userVarList = CPH.GetTwitchUsersVar<long>("userVar", true);
//For each loop which prints infos into Log File of the userVarList
foreach(UserVariableValue<long> userVar in userVarList)
{
string displayName = userVar.UserName;
string userId = userVar.UserId;
string userLogin = userVar.UserLogin;
//Actual value of user variable must be of same type previousy defined
long value = userVar.Value;
//Last time the user var was updated for the user
DateTime lastUpdate = userVar.LastWrite;
CPH.LogInfo($"{displayName} - {userId} - {userLogin} - {value} - {lastUpdate}");
}
return true;
}
}