Add example for generic chat-addable commands

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-06-30 01:37:41 +02:00
parent 13a6dd5695
commit 04d415810d
Signed by: luzifer
GPG Key ID: 0066F03ED215AD7D

View File

@ -207,6 +207,35 @@ The example was dumped using this action:
## Rule examples ## Rule examples
### Chat-addable generic text-respond-commands
```yaml
# Respond with variable content if set
- actions:
- respond: '{{ variable (concat ":" "genericcmd" .channel (group 1)) }}'
disable_on_template: '{{ eq (variable (concat ":" "genericcmd" .channel (group 1))) "" }}'
match_channels: ['#mychannel']
match_message: '^!([^\s]+)(?: |$)'
# Set variable content to content of chat command
- actions:
- variable: '{{ concat ":" "genericcmd" .channel (group 1) }}'
set: '{{ group 2 }}'
- respond: '[Admin] Set command !{{ group 1 }} to "{{ group 2 }}"'
enable_on: [broadcaster, moderator]
match_channels: ['#mychannel']
match_message: '^!setcmd ([^\s]+) (.*)'
# Remove variable and therefore delete command
- actions:
- variable: '{{ concat ":" "genericcmd" .channel (group 1) }}'
clear: true
- respond: '[Admin] Deleted command !{{ group 1 }}'
enable_on: [broadcaster, moderator]
match_channels: ['#mychannel']
match_message: '^!clearcmd ([^\s]+)'
```
### Game death counter with dynamic name ### Game death counter with dynamic name
```yaml ```yaml