Action Queues

C# Methods for Core > Action Queues

PauseActionQueue

Pause a specific action queue by name

public void PauseActionQueue(string name)

PauseAllActionQueues

Pause all action queues

public void PauseAllActionQueues()

ResumeActionQueue

Resume action queue, optionally clear all pending actions before resume

public void ResumeActionQueue(string name, bool clear = false)

ResumeAllActionQueues

Resume all paused queues, optionally clear all pending actions before resume

public void ResumeAllActionQueues(bool clear = false)

ActionExists

Check if an action exist by name
Returns a boolean indicating whether the action exists.

public bool ActionExists(string actionName)

DisableAction

Disables an action, by name

public void DisableAction(string actionName)

DisableActionById

Disables an action, by ID

0.2.4
public void DisableActionById(string actionId)

EnableAction

Enables an action, by name

public void EnableAction(string actionName)

EnableActionById

Enables an action, by ID

0.2.4
public void EnableActionById(string actionId)

GetActions

Returns a list of action data for all available actions

0.2.4
public List<ActionData> GetActions()

RunAction

Run an action, by name

Returns a boolean indicating whether the operation was successful.

public bool RunAction(string actionName, bool runImmediately = true)

RunActionById

Run an action, by id

Returns a boolean indicating whether the operation was successful.

public bool RunActionById(string actionId, bool runImmediately = true)

SetArgument

Set an argument to be used in subsequent sub-actions

public void SetArgument(string variableName, object value)

TryGetArg

Load an argument and parse it into a C# variable type

0.2.3
public bool TryGetArg<T>(string argName, out T& value)
0.2.3
public bool TryGetArg(string argName, out Object& value)

ExecuteMethod

public bool ExecuteMethod(string executeCode, string methodName)

CommandAddToAllUserCooldowns

Will add time(seconds) to all current user cooldowns of a command, by ID

0.2.4
public void CommandAddToAllUserCooldowns(string id, int seconds)

CommandAddToGlobalCooldown

Will add time(seconds) to current global cooldown of a command, by ID

0.2.4
public void CommandAddToGlobalCooldown(string id, int seconds)

CommandAddToUserCooldown

Will add time(seconds) to the specified user's cooldown of a command, by ID

0.2.4
public void CommandAddToUserCooldown(string id, string userId, Platform platform, int seconds)
Deprecated
0.2.4
public void CommandAddToUserCooldown(string id, int userId, int seconds)

CommandGetCounter

Returns the total number of command uses, by ID

0.2.4
public int CommandGetCounter(string commandId)

CommandGetUserCounter

Returns the total number of times a user has executed the specified command

0.2.4
public CommandCounter CommandGetUserCounter(string userLogin, Platform platform, string commandId)

CommandGetUserCounterById

Returns the total number of times a user has executed the specified command, by ID

0.2.4
public CommandCounter CommandGetUserCounterById(string userId, Platform platform, string commandId)

CommandRemoveAllUserCooldowns

Remove all user cooldowns associated with the specified command, by ID

0.2.4
public void CommandRemoveAllUserCooldowns(string id)

CommandRemoveGlobalCooldown

Remove global cooldown associated with the specified command, by ID

0.2.4
public void CommandRemoveGlobalCooldown(string id)

CommandRemoveUserCooldown

Remove the specified user's cooldown of a command, by ID

0.2.4
public void CommandRemoveUserCooldown(string id, string userId, Platform platform)
Deprecated
0.2.4
public void CommandRemoveUserCooldown(string id, int userId)

CommandResetAllUserCooldowns

Reset all users cooldowns on all platforms associated with the specified command, by ID

0.2.4
public void CommandResetAllUserCooldowns(string id)

CommandResetAllUserCounters

Resets all user counters associated with the specified command, by ID

0.2.4
public void CommandResetAllUserCounters(string commandId)

CommandResetCounter

Resets the total counter for the given command, by ID

0.2.4
public void CommandResetCounter(string commandId)

CommandResetGlobalCooldown

Resets global cooldown of command, by ID

0.2.4
public void CommandResetGlobalCooldown(string id)

CommandResetUserCooldown

Reset the specified user's cooldown of a command, by ID

0.2.4
public void CommandResetUserCooldown(string id, string userId, Platform platform)
Deprecated
0.2.4
public void CommandResetUserCooldown(string id, int userId)

CommandResetUserCounter

Resets the counter for a specified user for the given command, by ID

0.2.4
public void CommandResetUserCounter(string commandId, string userId, Platform platform)

CommandResetUsersCounters

Resets the total counter for all users of a platform for the given command, by ID

0.2.4
public void CommandResetUsersCounters(string userId, Platform platform, bool persisted)

CommandSetGlobalCooldownDuration

Set the global cooldown duration of a command, by ID

0.2.4
public void CommandSetGlobalCooldownDuration(string id, int seconds)

CommandSetUserCooldownDuration

Set the user cooldown duration of a command, by ID

0.2.4
public void CommandSetUserCooldownDuration(string id, int seconds)

DisableCommand

Disables a command, by ID

public void DisableCommand(string id)

EnableCommand

Enables a command, by ID

public void EnableCommand(string id)

GetCommands

Returns all commands associated with Streamer.bot instance

0.2.5
public List<CommandData> GetCommands()

GetEventType

Fetch the value of the __source variable

public EventType GetEventType()

GetSource

Fetch the value of the eventSource variable

public EventSource GetSource()

ClearNonPersistedGlobals

Remove all non-persisted global variables

public void ClearNonPersistedGlobals()

ClearNonPersistedUserGlobals

Remove all non-persisted global user variables

public void ClearNonPersistedUserGlobals()

GetGlobalVar<T>

Fetch a global variable by name

public T GetGlobalVar<T>(string varName, bool persisted = true)

GetGlobalVarValues

Fetch a list of all global variable values

public List<GlobalVariableValue> GetGlobalVarValues(bool persisted = true)

GetUserVar<T>

Use Twitch and YouTube methods instead

Deprecated
public T GetUserVar<T>(string userName, string varName, bool persisted = true)

SetGlobalVar

Set the value for a global variable

public void SetGlobalVar(string varName, object value, bool persisted = true)

SetUserVar

Use Twitch and YouTube methods instead

Deprecated
public void SetUserVar(string userName, string varName, object value, bool persisted = true)

UnsetAllUsersVar

Unset a user variable for all users

0.2.1
public void UnsetAllUsersVar(string varName, bool persisted = true)

UnsetGlobalVar

Remove a global variable by name

public void UnsetGlobalVar(string varName, bool persisted = true)

UnsetUser

Use Twitch and YouTube methods instead

Deprecated
public void UnsetUser(string userName, bool persisted = true)

UnsetUserVar

Use Twitch and YouTube methods instead

Deprecated
public void UnsetUserVar(string userName, string varName, bool persisted = true)

LogDebug

public void LogDebug(string logLine)

LogError

public void LogError(string logLine)

LogInfo

public void LogInfo(string logLine)

LogVerbose

public void LogVerbose(string logLine)

LogWarn

public void LogWarn(string logLine)

MidiSendControlChange

public void MidiSendControlChange(Guid deviceId, int channel, int controller, int value)

MidiSendControlChangeByName

public void MidiSendControlChangeByName(string name, int channel, int controller, int value)

MidiSendNoteOn

public void MidiSendNoteOn(Guid deviceId, int channel, int note, int velocity, int duration = 0, bool sendNoteOff = false)

MidiSendNoteOnByName

public void MidiSendNoteOnByName(string name, int channel, int note, int velocity, int duration = 0, bool sendNoteOff = false)

MidiSendRaw

public void MidiSendRaw(Guid deviceId, int command, int channel, int data1, int data2)

MidiSendRawByName

public void MidiSendRawByName(string name, int command, int channel, int data1, int data2)

Between

Returns a random int value between(including) min and max

public int Between(int min, int max)

EscapeString

public string EscapeString(string text)

GetVersion

Returns the SemVersion of the current Streamer.bot installation

0.2.4
public string GetVersion()

NextDouble

Returns a double type between 0 and 1. Often used for random percentages

public double NextDouble()

UrlEncode

public string UrlEncode(string text)

Wait

Will make the code wait for specified amount of time, in ms

public void Wait(int milliseconds)

AddQuoteForTrovo

public int AddQuoteForTrovo(string userId, string quote, bool captureGame = false)

AddQuoteForTwitch

public int AddQuoteForTwitch(string userId, string quote, bool captureGame = false)

AddQuoteForYouTube

public int AddQuoteForYouTube(string userId, string quote)

DeleteQuote

public bool DeleteQuote(int quoteId)

GetQuote

public QuoteData GetQuote(int quoteId)

GetQuoteCount

public int GetQuoteCount()

PlaySound

public double PlaySound(string fileName, Single volume = 1, bool finishBeforeContinuing = false, string name, bool useFileName = true)

PlaySoundFromFolder

public double PlaySoundFromFolder(string path, Single volume = 1, bool recursive = false, bool finishBeforeContinuing = false, string name, bool useFileName = true)

StopAllSoundPlayback

Stops all sounds from playing that were started by Streamer.bot

0.2.4
public void StopAllSoundPlayback()

StopSoundPlayback

Stops the currently playing sound from Streamer.bot, by name

0.2.4
public void StopSoundPlayback(string soundName)

KeyboardPress

Simulate a keyboard input

public void KeyboardPress(string keyPress)

This CPH method uses the SendKeys method.

The keyPress string argument needs to be enclosed in curly brackets {}.

To use key combinations such as SHIFT, CTRL and ALT, you can use code modifiers listed in the link below.

Full reference of all SendKeys keystroke values and modifiers.

ShowToastNotification

public void ShowToastNotification(string id, string title, string message, string attribution, string iconPath)
public void ShowToastNotification(string title, string message, string attribution, string iconPath)

DisableTimer

public void DisableTimer(string timerName)

DisableTimerById

Disables selected timer, by ID

0.2.4
public void DisableTimerById(string timerId)

EnableTimer

public void EnableTimer(string timerName)

EnableTimerById

Enables selected timer, by ID

0.2.4
public void EnableTimerById(string timerId)

GetTimerState

Get the state of an existing timer

0.2.4
public bool GetTimerState(string timerId)

SetTimerInterval

Set the interval of an existing timer, in seconds

0.2.4
public void SetTimerInterval(string timerId, int interval)

RegisterCustomTrigger

Register a custom trigger

0.2.0
public bool RegisterCustomTrigger(string triggerName, string eventName, String[] categories)

TriggerCodeEvent

Triggers a custom code event name (see RegisterCustomTrigger)

0.2.5
public void TriggerCodeEvent(string eventName, string json)
0.2.5
public void TriggerCodeEvent(string eventName, Dictionary<string,object> args)
0.2.5
public void TriggerCodeEvent(string eventName, bool useArgs = true)

TriggerEvent

Trigger custom events that are defined with the Custom Event Trigger

0.2.0
public void TriggerEvent(string eventName, bool useArgs = true)

BroadcastUdp

public int BroadcastUdp(int port, object data)

AddGroup

Creates a new group with the given name

0.2.4
public bool AddGroup(string groupName)

AddUserIdToGroup

Add a user, by ID, to a group

0.2.3
public bool AddUserIdToGroup(string userId, Platform platform, string groupName)

AddUserToGroup

Add a user, by username (login name), to a group

0.2.3
public bool AddUserToGroup(string userName, Platform platform, string groupName)

ClearUsersFromGroup

Remove all users from a group

0.2.3
public bool ClearUsersFromGroup(string groupName)

DeleteGroup

Deletes the group matching the provided name

0.2.4
public bool DeleteGroup(string groupName)

GetGroups

Returns a list of all available groups

0.2.4
public List<string> GetGroups()

GroupExists

Returns bool verifying existence of a group, by name

0.2.4
public bool GroupExists(string groupName)

RemoveUserFromGroup

Remove a user, by username (login name), from a group

0.2.3
public bool RemoveUserFromGroup(string userName, Platform platform, string groupName)

RemoveUserIdFromGroup

Remove a user, by ID, from a group

0.2.3
public bool RemoveUserIdFromGroup(string userId, Platform platform, string groupName)

UserIdInGroup

Check if a user, by ID, is a member of a group

0.2.3