[docs] Add "VIP of the Month" example rule (thanks to @Breitling1992)

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-08-22 17:29:44 +02:00
parent d92824a892
commit f79152159a
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -157,3 +157,39 @@ title: "Rule Examples"
match_message: '^!so ([@\w]+)' match_message: '^!so ([@\w]+)'
``` ```
## VIP of the Month
In this example a channel-point reward for one month of VIP status exists which is automated through the bot. To get the `.reward_id` you can use the [Debug-Overlay]({{< ref "../overlays/_index.md" >}}) or just use the `.reward_title` variable and check against the name of the reward.
```yaml
- description: 'Channel-Point-Reward: VIP of the month'
actions:
- type: vip
attributes:
channel: '{{ .channel }}'
user: '{{ .user }}'
- type: customevent
attributes:
fields: |-
{{
toJson (
dict
"targetChannel" .channel
"targetUser" .user
"type" "timed_unvip"
)
}}
schedule_in: 744h
match_event: channelpoint_redeem
disable_on_template: '{{ ne .reward_id "aaa66d18-8dab-46f4-a222-6ff228f2fdfb" }}'
disable_on: [moderator, vip]
- description: 'Channel-Point-Reward: Remove VIP of the month'
actions:
- type: unvip
attributes:
channel: '{{ .targetChannel }}'
user: '{{ .targetUser }}'
match_event: custom
disable_on_template: '{{ ne .type "timed_unvip" }}'
```