Execute Code Available Methods - nate1280/ChannelPointsHandler GitHub Wiki

Below are all the methods that can be accessed via the CPH object that is is available in your inline scripts

int Between(int min, int max);
double NextDouble(); // get a random value between 0f and 1f
void Wait(int milliseconds);
string UrlEncode(string text);
string EscapeString(string text);
void SetArgument(string variableName, object value); // set an argument to be used in subsequent sub-actions
EventSource GetSource();
EventType GetEventType();
void SendMessage(string message, bool bot = true);
void SendAction(string action, bool bot = true);
void SendWhisper(string userName, string message);
void TimeoutUser(string userName, int duration);
bool RunAction(string actionName);
void LogInfo(string logLine);
void LogWarn(string logLine);
void LogDebug(string logLine);
void DisableTimer(string timerName);
void EnableTimer(string timerName);
void DisableReward(string rewardId);
void EnableReward(string rewardId);
void PauseReward(string rewardId);
void UnPauseReward(string rewardId);
void UpdateRewardCost(string rewardId, int cost, bool additive = false);
void UpdateRewardCooldown(string rewardId, int cooldown, bool additive = false);
string TwitchRedemptionFulfill(string rewardId, string redemptionId);
string TwitchRedemptionCancel(string rewardId, string redemptionId);
void PlaySound(string fileName, bool immediately = false);
void PlaySoundFromFolder(string path, bool recursive = false, bool immediately = false);
int BroadcastUdp(int port, object data);
bool ObsIsConnected(int connection = 0);
bool ObsConnect(int connection = 0);
void ObsDisconnect(int connection = 0);
bool ObsIsStreaming(int connection = 0);
void ObsStopStreaming(int connection = 0);
bool ObsIsRecording(int connection = 0);
void ObsStartRecording(int connection = 0);
void ObsStopRecording(int connection = 0);
void ObsPauseRecording(int connection = 0);
void ObsResumeRecording(int connection = 0);
void ObsSetScene(string sceneName, int connection = 0);
string ObsGetCurrentScene(int connection = 0);
bool ObsIsSourceVisible(string scene, string source, int connection = 0);
void ObsSetSourceVisibility(string scene, string source, bool visible, int connection = 0);
void ObsShowSource(string scene, string source, int connection = 0);
void ObsHideSource(string scene, string source, int connection = 0);
void ObsHideGroupsSources(string scene, string groupName, int connection = 0);
string ObsSetRandomGroupSourceVisible(string scene, string groupName, int connection = 0);
List<string> ObsGetGroupSources(string scene, string groupName, int connection = 0);
void ObsSetBrowserSource(string scene, string source, string url, int connection = 0);
void ObsSetGdiText(string scene, string source, string text, int connection = 0);
bool ObsIsFilterEnabled(string scene, string filterName, int connection = 0);
bool ObsIsFilterEnabled(string scene, string source, string filterName, int connection = 0);
void ObsSetFilterState(string scene, string filterName, int state, int connection = 0);
void ObsSetFilterState(string scene, string source, string filterName, int state, int connection = 0);
void ObsShowFilter(string scene, string filterName, int connection = 0);
void ObsShowFilter(string scene, string source, string filterName, int connection = 0);
void ObsHideFilter(string scene, string filterName, int connection = 0);
void ObsHideFilter(string scene, string source, string filterName, int connection = 0);
void ObsToggleFilter(string scene, string filterName, int connection = 0);
void ObsToggleFilter(string scene, string source, string filterName, int connection = 0);
void ObsSetRandomFilterState(string scene, int state, int connection = 0);
void ObsSetRandomFilterState(string scene, string source, int state, int connection = 0);
void ObsSetSourceMuteState(string scene, string source, int state, int connection = 0);
void ObsSourceMute(string scene, string source, string filterName, int connection = 0);
void ObsSourceUnMute(string scene, string source, string filterName, int connection = 0);
void ObsSourceMuteToggle(string scene, string source, string filterName, int connection = 0);
bool ObsSendRaw(string requestType, JObject data, int connection = 0);
T GetGlobalVar<T>(string varName, bool persisted = true);
void SetGlobalVar(string varName, object value, bool persisted = true);
void UnsetGlobalVar(string varName, bool persisted = true);
T GetUserVar<T>(string userName, string varName, bool persisted = true);
void SetUserVar(string userName, string varName, object value, bool persisted = true);
void UnsetUserVar(string userName, string varName, bool persisted = true);
void UnsetUser(string userName, bool persisted = true);
void WebsocketConnect(int connection = 0);
void WebsocketDisconnect(int connection = 0);
bool WebsocketIsConnected(int connection = 0);
void WebsocketSend(string data, int connection = 0);
void WebsocketSend(byte[] data, int connection = 0);
void WebsocketBroadcastString(string data); // send a custom event over the websocket server
void WebsocketBroadcastJson(string data); // send a custom event over the websocket server
void AddToCredits(string section, string value, bool json = true)

Available as of 0.50

For OBS:

bool ObsIsFilterEnabled(string scene, string filterName, int connection = 0)

For Twitch Channel Rewards

void UpdateRewardCooldown(string rewardId, int cooldown, bool additive = false);

For Slobs:

bool SlobsIsConnected(int connection = 0);
bool SlobsConnect(int connection = 0);
void SlobsDisconnect(int connection = 0);
bool SlobsIsStreaming(int connection = 0);
void SlobsStopStreaming(int connection = 0);
void SlobsStartStreaming(int connection = 0);
bool SlobsIsRecording(int connection = 0);
void SlobsStartRecording(int connection = 0);
void SlobsStopRecording(int connection = 0);
void SlobsPauseRecording(int connection = 0);
void SlobsResumeRecording(int connection = 0);
void SlobsSetScene(string sceneName, int connection = 0);
string SlobsGetCurrentScene(int connection = 0);
bool SlobsIsSourceVisible(string scene, string source, int connection = 0);
void SlobsSetSourceVisibility(string scene, string source, bool visible, int connection = 0);
void SlobsShowSource(string scene, string source, int connection = 0);
void SlobsHideSource(string scene, string source, int connection = 0);
void SlobsHideGroupsSources(string scene, string groupName, int connection = 0);
string SlobsSetRandomGroupSourceVisible(string scene, string groupName, int connection = 0);
List<string> SlobsGetGroupSources(string scene, string groupName, int connection = 0);
void SlobsSetBrowserSource(string scene, string source, string url, int connection = 0);
void SlobsSetGdiText(string scene, string source, string text, int connection = 0);
bool SlobsIsFilterEnabled(string scene, string filterName, int connection = 0);
bool SlobsIsFilterEnabled(string scene, string source, string filterName, int connection = 0);
void SlobsSetFilterState(string scene, string filterName, int state, int connection = 0);
void SlobsSetFilterState(string scene, string source, string filterName, int state, int connection = 0);
void SlobsShowFilter(string scene, string filterName, int connection = 0);
void SlobsShowFilter(string scene, string source, string filterName, int connection = 0);
void SlobsHideFilter(string scene, string filterName, int connection = 0);
void SlobsHideFilter(string scene, string source, string filterName, int connection = 0);
void SlobsToggleFilter(string scene, string filterName, int connection = 0);
void SlobsToggleFilter(string scene, string source, string filterName, int connection = 0);
void SlobsSetRandomFilterState(string scene, int state, int connection = 0);
void SlobsSetRandomFilterState(string scene, string source, int state, int connection = 0);
void SlobsSetSourceMuteState(string scene, string source, int state, int connection = 0);
void SlobsSourceMute(string scene, string source, string filterName, int connection = 0);
void SlobsSourceUnMute(string scene, string source, string filterName, int connection = 0);
void SlobsSourceMuteToggle(string scene, string source, string filterName, int connection = 0);

For Pausing Action Queues

void PauseActionQueue(string name);
void PauseAllActionQueues();
void ResumeActionQueue(string name, bool clear = false);
void ResumeAllActionQueues(bool clear = false);

Miscellaneous Methods

List<Cheermote> GetCheermotes();

Clip Methods

List<ClipData> GetAllClips();
List<ClipData> GetClipsForGame(int gameId);
List<ClipData> GetClipsForUser(int userId);
List<ClipData> GetClipsForUser(string username);

ClipData contains the following values

string Id;
string Url;
string EmbedUrl;
int BroadcasterId;
string BroadcasterName;
int CreatorId;
string CreatorName;
string VideoId;
string GameId;
string Language;
string Title;
int ViewCount;
DateTime CreatedAt;
string ThumbnailUrl;
float Duration;

Available as of 0.58

For Groups:

bool UserInGroup(int userId, string groupName);
bool UserInGroup(string userName, string groupName);
bool AddUserToGroup(int userId, string groupName);
bool AddUserToGroup(string userName, string groupName);
bool RemoveUserFromGroup(int userId, string groupName);
bool RemoveUserFromGroup(string userName, string groupName);

Available as of 0.59

void ResetCredits();
void ResetFirstWords();

For OBS:

void ObsHideSourcesFilters(string scene, string source, int connection = 0);
void ObsHideScenesFilters(string scene, int connection = 0);

For Custom Websocket Servers:

void WebsocketCustomServerStart(int connection = 0);
void WebsocketCustomServerStop(int connection = 0);
bool WebsocketCustomServerIsListening(int connection = 0);
void WebsocketCustomServerCloseAllSessions(int connection = 0);
void WebsocketCustomServerCloseSession(string sessionId, int connection = 0);
void WebsocketCustomServerBroadcast(string data, string sessionId, int connection = 0);

Available as of 0.61

void DisableAction(string actionName);
void EnableAction(string actionName);

For Twitch Polls

bool TwitchPollCreate(string title, List<string> choices, int duration, int bitsPerVote = 0, int channelPointsPerVote = 0);
void TwitchPollTerminate(string pollId);
void TwitchPollArchive(string pollId);
⚠️ **GitHub.com Fallback** ⚠️