1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul-website synced 2024-11-21 21:22:21 +00:00
strimertul-website/content/guide/features/loyalty-system.md
Ash Keel 8d3572039d
All checks were successful
continuous-integration/drone/push Build is passing
renko, also avif
2023-11-12 12:05:04 +01:00

149 lines
7.4 KiB
Markdown

---
title: Loyalty system
menu:
guides:
parent: features
weight: 100
---
The loyalty system in strimertül allows your viewer to accrue points by just sticking around and chatting to then spend them on rewards and community goal. It's pretty much a third party implementation to Twitch Channel point system, but does not require you to sign into affiliate.
Compared to Twitch channel points:
- ⭕ Does not require Twitch Affiliate or Partner
- ⭕ You can check and edit the balance of every viewer at any time
- ❌ There is no UI for viewers to easily check all rewards and claim them outside of chat
- ❌ Points are accrued not based on watch time but chat activity (for technical reasons)
Some other current limitations that might be fixed in the future include:
- Points are linked to usernames and not user IDs, which means viewers will lose their points when changing their name
- There is only a per-prize cooldown option, eg. no way to limit number of redemptions per stream
- There is no daily cap on contributing to goals
- Points contributed to goals cannot be refunded
If these limits feel acceptable to you, here's how to set the loyalty system up and running in your streams.
To access the loyalty system configuration, locate its section in the side menu.
![The loyalty system configuration pages in the side bar](../media/loyalty/menu.png)
## Configuration
The configuration page lets you turn on or off the entire loyalty system, along some settings on how points are awarded to users.
The most important settings are "How often to give wishes" and "Bonus points". The first sets how often and how many points to give to any user currently logged into chat, while the latter is an extra amount of points added to the former (using the same interval) that is awarded specifically to users who have written at least one chat message during said interval.
It is heavily recommended to keep the interval in the minutes range. This alleviates load on strimertül (since every interval there's some awarding logic and Twitch API calls to execute) and makes sure the bonus points are awarded properly. A good setting would be "10 points every 10 minutes, with 10 bonus points".
Viewers are never notified of gaining points, or if they received extra points. It is up to you to make this logic public or not.
## Rewards and goals
### Rewards tab
The rewards page lets you set up rewards that viewers can redeem and goals for them to contribute towards.
These rewards are currently only visible to you, so you have to take care to inform your viewers that they exist and what they are.
![The loyalty system rewards page](../media/loyalty/reward-overview.png)
You can create rewards by clicking the "Create reward" button, or toggle/edit/delete them with the buttons in the top right of each reward entry.
![The dialog to create and edit rewards](../media/loyalty/redeem-create.png)
Rewards have a multitude of properties but for most people only the ID (used by viewers to redeem them) and name (used by the bot to describe it) are really important, everything else (description/icon) are not exposed to users.
The cooldown property is a per-reward cooldown and not per-user, so claiming a reward will lock it out for that amount of time from anyone.
Rewards can be refunded (see the following section in Points and redeems).
### Goals tab
The goals page works almost exactly to the rewards one, with a few exceptions since goals work a bit differently.
![The loyalty system goals page](../media/loyalty/goal-overview.png)
Goals work by setting a target amount of points to reach. Any viewer can contribute any amount of points to goals at any time (provided they have enough).
![The dialog to create and edit goals](../media/loyalty/goal-dialog.png)
Like in rewards, only the goal ID and name are user facing by default, so fields like icon and description can be omitted.
The target point goal can be modified while a goal is active (even after it's been reached) but this should only be done very carefully.
Unlike rewards, there is no way to refund contributed points to a goal.;
## Points and redeems
### Redeem queue
In the redeem queue page you can check out all pending redeems from viewers.
![The redeem queue page](../media/loyalty/redeem-queue.png)
Redeems can be accepted or refunded. If accepted the redeem simply disappears from the list while a refund will remove the redeem while also giving back the points to the viewer that claimed the reward.
### Manage points
The point management page gives you a full list of everyone who has been assigned loyalty points at any point. You can sort it by name or balance and have full control over anyone's balance!
![The point management page](../media/loyalty/point-list.png)
To edit someone's balance, find the entry in the table (you can use the search field to narrow down results) then click the "Edit" in the far right to open up the dialog to modify their balance, set the new balance then click "Save".
![Dialog to modify someone's point balance](../media/loyalty/edit-balance.png)
If the viewer you're looking for is not in the list, click the "Give points" button instead, then put in their username and wanted balance. If you use this method on a viewer with an existing balance, those points will be added to their existing balance.
![Dialog to give someone points](../media/loyalty/give-points.png)
## Chat commands
When activated, the loyalty system adds a few commands to the chatbot:
#### !redeem
The `!redeem` command lets viewers redeem a reward. The syntax is `!redeem REWARD-ID`.
![Using the !redeem command](../media/loyalty/chat-redeem.png)
If the reward requires viewer info, it becomes `!redeem REWARD-ID extra info here`.
#### !balance
The `!balance` command lets viewers check their current balance.
![Using the !balance command](../media/loyalty/balance.png)
#### !goals
The `!goals` command lets viewers check what goals are currently active.
![Using the !goals command](../media/loyalty/goals-list.png)
#### !contribute
The `!contribute` command lets viewers contribute points to a community goal. This command has one main syntax and several shortcuts.
The main syntax is `!contribute POINTS GOAL-ID`.
![Using the !contribute command with the full syntax](../media/loyalty/contribute-chat.png)
There are several shortcuts for this. You can use `!contribute POINTS` to contribute to the first available goal (since most of the time you're going to have only one goal anyway) or `!contribute GOALID` to contribute 100 points to the specified goal id.
You can combine both by just using `!contribute` to contribute 100 points to the first available goal.
![Using the !contribute shortcuts](../media/loyalty/contribute-shortcut.png)
## External scripts and extensions
Like the rest of strimertül, the loyalty system uses Kilovolt keys for everything:
- Every viewer with points has a balance accessible at [`loyalty/points/<username>`](/api/v31/#loyaltypointsuser)
- All pending redeems are stored as an array at [`loyalty/redeem-queue`](/api/v31/#loyaltyredeem-queue)
- The list of all rewards to redeem can be found at [`loyalty/rewards`](/api/v31/#loyaltyrewards)
- The list of all goals is at [`loyalty/goals`](/api/v31/#loyaltygoals)
- To listen for new redeems, subscribe to [`loyalty/ev/new-redeem`](/api/v31/#loyaltyevnew-redeem)
- To create a new redeem, write to [`loyalty/@create-redeem`](/api/v31/#loyaltycreate-redeem)
- To remove a redeem from the queue, write to [`loyalty/@remove-redeem`](/api/v31/#loyaltyremove-redeem)