mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 20:01:17 +00:00
Add example for generic chat-addable commands
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
13a6dd5695
commit
04d415810d
1 changed files with 29 additions and 0 deletions
29
wiki/Home.md
29
wiki/Home.md
|
@ -207,6 +207,35 @@ The example was dumped using this action:
|
|||
|
||||
## 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
|
||||
|
||||
```yaml
|
||||
|
|
Loading…
Reference in a new issue