diff --git a/streamerbot/3.api/1.sub-actions/core/logic/if-else.md b/streamerbot/3.api/1.sub-actions/core/logic/if-else.md index 47f36cfd..3f6b54b5 100755 --- a/streamerbot/3.api/1.sub-actions/core/logic/if-else.md +++ b/streamerbot/3.api/1.sub-actions/core/logic/if-else.md @@ -51,6 +51,33 @@ parameters: Enter the value you would like to use for comparison. This field is parsed, so may contain other `%arguments%`{lang=cs}, `~persistedGlobals~`{lang=cs} and `$inlineFunctions()$` + +variables: + - name: match.count + type: int + description: | + Only when using "Regex Match" as the operator. + + The number of match groups (named or unnamed) in the regex. + + Note that this is always 1 more than the number of parentheses groups, as the entire match is implicitly group 0. + value: 3 + - name: match[] + type: string + description: | + Only when using "Regex Match" as the operator. + + The text matching each indexed capture group. + + Index 0 is the entire matching text, and the first parenthesized group is 1. + value: 'matching word' + - name: + type: string + description: | + Only when using "Regex Match" as the operator. + + When using named capture groups (e.g, `(?'points'\d+)` or `(?\d+)` ), each named capture group becomes an argument containing the text of the match. + value: '123' --- ::collapsible{name="If/Else Flow Diagram by pwnyy"} diff --git a/streamerbot/3.api/2.triggers/core/commands/command-triggered.md b/streamerbot/3.api/2.triggers/core/commands/command-triggered.md index d23b7af9..1da94b2c 100755 --- a/streamerbot/3.api/2.triggers/core/commands/command-triggered.md +++ b/streamerbot/3.api/2.triggers/core/commands/command-triggered.md @@ -49,6 +49,31 @@ variables: type: number description: A running total of how many times the command has been run by current user since application launch value: 17 + - name: match.count + type: int + description: | + Only when the command mode = "Regex" + + The number of match groups (named or unnamed) in the regex. + + Note that this is always 1 more than the number of parentheses groups, as the entire match is implicitly group 0. + value: 3 + - name: match[] + type: string + description: | + Only when the command mode = "Regex" + + The text matching each indexed capture group. + + Index 0 is the entire matching text, and the first parenthesized group is 1. + value: 'matching word' + - name: + type: string + description: | + Only when the command mode = "Regex" + + When using named capture groups (e.g, `(?'points'\d+)` or `(?\d+)` ), each named capture group becomes an argument containing the text of the match. + value: '123' commonVariables: - TwitchReply - TwitchUser