diff --git a/loyalty/data.go b/loyalty/data.go index 7e39020..8ba04a7 100644 --- a/loyalty/data.go +++ b/loyalty/data.go @@ -5,14 +5,14 @@ import "time" const ConfigKey = "loyalty/config" type Config struct { - Enabled bool `json:"enabled"` - Currency string `json:"currency"` + Enabled bool `json:"enabled" desc:"Enable the loyalty system"` + Currency string `json:"currency" desc:"Name of the currency"` Points struct { - Interval int64 `json:"interval"` // in seconds! - Amount int64 `json:"amount"` - ActivityBonus int64 `json:"activity_bonus"` - } `json:"points"` - BanList []string `json:"banlist"` + Interval int64 `json:"interval" desc:"How often to distribute points, in seconds"` // in seconds! + Amount int64 `json:"amount" desc:"How many points to award every interval"` + ActivityBonus int64 `json:"activity_bonus" desc:"Extra points for active chatters"` + } `json:"points" desc:"Settings for distributing currency to online viewers"` + BanList []string `json:"banlist" desc:"Usernames to exclude from currency distribution"` } const RewardsKey = "loyalty/rewards" @@ -20,41 +20,41 @@ const RewardsKey = "loyalty/rewards" const GoalsKey = "loyalty/goals" type Reward struct { - Enabled bool `json:"enabled"` - ID string `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - Image string `json:"image"` - Price int64 `json:"price"` - CustomRequest string `json:"required_info,omitempty"` - Cooldown int64 `json:"cooldown"` + Enabled bool `json:"enabled" desc:"Is the reward enabled (redeemable)?"` + ID string `json:"id" desc:"Reward ID"` + Name string `json:"name" desc:"Name of the reward"` + Description string `json:"description" desc:"Description of the reward"` + Image string `json:"image" desc:"Reward icon URL"` + Price int64 `json:"price" desc:"How much does is cost"` + CustomRequest string `json:"required_info,omitempty" desc:"If present, reward requires user input and this field is the help text"` + Cooldown int64 `json:"cooldown" desc:"Time in seconds to wait before this reward can be redeemed again"` } type Goal struct { - Enabled bool `json:"enabled"` - ID string `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - Image string `json:"image"` - TotalGoal int64 `json:"total"` - Contributed int64 `json:"contributed"` - Contributors map[string]int64 `json:"contributors"` + Enabled bool `json:"enabled" desc:"Is the goal enabled?"` + ID string `json:"id" desc:"Community goal ID"` + Name string `json:"name" desc:"Name of the community goal"` + Description string `json:"description" desc:"Description of the goal"` + Image string `json:"image" desc:"Goal icon URL"` + TotalGoal int64 `json:"total" desc:"How many points does the goal need to be met in total"` + Contributed int64 `json:"contributed" desc:"How many points have been contributed so far"` + Contributors map[string]int64 `json:"contributors" desc:"Dictionary of how much every viewer has contributed"` } const PointsPrefix = "loyalty/points/" type PointsEntry struct { - Points int64 `json:"points"` + Points int64 `json:"points" desc:"Currency balance"` } const QueueKey = "loyalty/redeem-queue" type Redeem struct { - Username string `json:"username"` - DisplayName string `json:"display_name"` - Reward Reward `json:"reward"` - When time.Time `json:"when"` - RequestText string `json:"request_text"` + Username string `json:"username" desc:"Username of who redeemed the reward"` + DisplayName string `json:"display_name" desc:"Display name of who redeemed the reward"` + Reward Reward `json:"reward" desc:"Reward that was redeemed"` + When time.Time `json:"when" desc:"Time of the redeem"` + RequestText string `json:"request_text" desc:"If the reward required user input it will be here"` } const ( @@ -62,21 +62,3 @@ const ( RemoveRedeemRPC = "loyalty/@remove-redeem" RedeemEvent = "loyalty/ev/new-redeem" ) - -// Stulbe events - -type ExLoyaltyRedeem struct { - Username string `json:"username"` - DisplayName string `json:"display_name"` - Channel string `json:"channel"` - RewardID string `json:"reward_id"` - RequestText string `json:"request_text"` -} - -type ExLoyaltyContribute struct { - Username string `json:"username"` - DisplayName string `json:"display_name"` - Channel string `json:"channel"` - GoalID string `json:"goal_id"` - Amount int64 `json:"amount"` -} diff --git a/loyalty/doc.go b/loyalty/doc.go index 2b22de0..e6d3125 100644 --- a/loyalty/doc.go +++ b/loyalty/doc.go @@ -10,7 +10,7 @@ import ( var Keys = interfaces.KeyMap{ ConfigKey: interfaces.KeyDef{ - Description: "General configuration for the loyalty subsystem", + Description: "General configuration for the loyalty system", Type: reflect.TypeOf(Config{}), }, RewardsKey: interfaces.KeyDef{