[wiki] Remove deprecated concat
examples
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
aa420b4afd
commit
f562c2fec5
2 changed files with 6 additions and 19 deletions
|
@ -7,8 +7,8 @@
|
||||||
- actions:
|
- actions:
|
||||||
- type: respond
|
- type: respond
|
||||||
attributes:
|
attributes:
|
||||||
message: '{{ variable (concat ":" "genericcmd" .channel (group 1)) }}'
|
message: '{{ variable (list "genericcmd" .channel (group 1) | join ":") }}'
|
||||||
disable_on_template: '{{ eq (variable (concat ":" "genericcmd" .channel (group 1))) "" }}'
|
disable_on_template: '{{ eq (variable (list "genericcmd" .channel (group 1) | joih ":")) "" }}'
|
||||||
match_channels: ['#mychannel']
|
match_channels: ['#mychannel']
|
||||||
match_message: '^!([^\s]+)(?: |$)'
|
match_message: '^!([^\s]+)(?: |$)'
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
- actions:
|
- actions:
|
||||||
- type: setvariable
|
- type: setvariable
|
||||||
attributes:
|
attributes:
|
||||||
variable: '{{ concat ":" "genericcmd" .channel (group 1) }}'
|
variable: '{{ list "genericcmd" .channel (group 1) | join ":" }}'
|
||||||
set: '{{ group 2 }}'
|
set: '{{ group 2 }}'
|
||||||
- type: respond
|
- type: respond
|
||||||
attributes:
|
attributes:
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
- actions:
|
- actions:
|
||||||
- type: setvariable
|
- type: setvariable
|
||||||
attributes:
|
attributes:
|
||||||
variable: '{{ concat ":" "genericcmd" .channel (group 1) }}'
|
variable: '{{ list "genericcmd" .channel (group 1) | join ":" }}'
|
||||||
clear: true
|
clear: true
|
||||||
- type: respond
|
- type: respond
|
||||||
attributes:
|
attributes:
|
||||||
|
|
|
@ -69,19 +69,6 @@ Example:
|
||||||
< 5
|
< 5
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `concat`
|
|
||||||
|
|
||||||
Join the given string parts with delimiter (⚠ this replaces the sprig `concat` function: sprig `concat` is not available!)
|
|
||||||
|
|
||||||
Syntax: `concat <delimiter> <...parts>`
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```
|
|
||||||
# {{ concat ":" "test" .username }}
|
|
||||||
< test:luziferus
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `counterValue`
|
#### `counterValue`
|
||||||
|
|
||||||
Returns the current value of the counter which identifier was supplied
|
Returns the current value of the counter which identifier was supplied
|
||||||
|
@ -91,7 +78,7 @@ Syntax: `counterValue <counter name>`
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
# {{ counterValue (concat ":" .channel "test") }}
|
# {{ counterValue (list .channel "test" | join ":") }}
|
||||||
< 5
|
< 5
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -319,7 +306,7 @@ Syntax: `seededRandom <string-seed>`
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
# Your int this hour: {{ printf "%.0f" (multiply (seededRandom (concat ":" "int" .username (now "2006-01-02 15"))) 100) }}%
|
# Your int this hour: {{ printf "%.0f" (multiply (seededRandom (list "int" .username (now "2006-01-02 15") | join ":")) 100) }}%
|
||||||
< Your int this hour: 17%
|
< Your int this hour: 17%
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue