1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul synced 2024-09-20 02:00:49 +00:00
strimertul/loyalty/data.go
2022-12-04 00:04:15 +01:00

83 lines
2.1 KiB
Go

package loyalty
import "time"
const ConfigKey = "loyalty/config"
type Config struct {
Enabled bool `json:"enabled"`
Currency string `json:"currency"`
Points struct {
Interval int64 `json:"interval"` // in seconds!
Amount int64 `json:"amount"`
ActivityBonus int64 `json:"activity_bonus"`
} `json:"points"`
BanList []string `json:"banlist"`
}
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"`
}
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"`
}
const PointsPrefix = "loyalty/points/"
type PointsEntry struct {
Points int64 `json:"points"`
}
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"`
}
const (
CreateRedeemRPC = "loyalty/@create-redeem"
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"`
}