Documentation ¶
Index ¶
- type Plan
- type PlanFeatures
- type PremiumManager
- func (m *PremiumManager) GetEntitledUserIDs(ctx context.Context) ([]string, error)
- func (m *PremiumManager) GetPlanByID(id string) *Plan
- func (m *PremiumManager) GetPlanBySKUID(skuID string) *Plan
- func (m *PremiumManager) GetPlanFeaturesForGuild(ctx context.Context, guildID string) (PlanFeatures, error)
- func (m *PremiumManager) GetPlanFeaturesForUser(ctx context.Context, userID string) (PlanFeatures, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plan ¶
type Plan struct { ID string `mapstructure:"id"` SKUID string `mapstructure:"sku_id"` Default bool `mapstructure:"default"` Features PlanFeatures `mapstructure:"features"` }
type PlanFeatures ¶
type PlanFeatures struct { MaxSavedMessages int `mapstructure:"max_saved_messages"` MaxActionsPerComponent int `mapstructure:"max_actions_per_component"` AdvancedActionTypes bool `mapstructure:"advanced_action_types"` AIAssistant bool `mapstructure:"ai_assistant"` CustomBot bool `mapstructure:"custom_bot"` MaxCustomCommands int `mapstructure:"max_custom_commands"` IsPremium bool `mapstructure:"is_premium"` MaxImageUploadSize int `mapstructure:"max_image_upload_size"` MaxScheduledMessages int `mapstructure:"max_scheduled_messages"` PeriodicScheduledMessages bool `mapstructure:"periodic_scheduled_messages"` }
func (*PlanFeatures) Merge ¶
func (f *PlanFeatures) Merge(b PlanFeatures)
type PremiumManager ¶
type PremiumManager struct {
// contains filtered or unexported fields
}
func New ¶
func New(pg *postgres.PostgresStore, bot *bot.Bot) *PremiumManager
func (*PremiumManager) GetEntitledUserIDs ¶
func (m *PremiumManager) GetEntitledUserIDs(ctx context.Context) ([]string, error)
func (*PremiumManager) GetPlanByID ¶
func (m *PremiumManager) GetPlanByID(id string) *Plan
func (*PremiumManager) GetPlanBySKUID ¶
func (m *PremiumManager) GetPlanBySKUID(skuID string) *Plan
func (*PremiumManager) GetPlanFeaturesForGuild ¶
func (m *PremiumManager) GetPlanFeaturesForGuild(ctx context.Context, guildID string) (PlanFeatures, error)
func (*PremiumManager) GetPlanFeaturesForUser ¶
func (m *PremiumManager) GetPlanFeaturesForUser(ctx context.Context, userID string) (PlanFeatures, error)
Click to show internal directories.
Click to hide internal directories.