boost_request_manager

package
v0.0.0-...-2e419a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPrivileges error = &BoostRequestSignupError{
		message: "the user has no privileges",
	}
	ErrNotPreferredAdvertiser error = &BoostRequestSignupError{
		message: "the user is not a preferred advertiser",
	}
)

Functions

This section is empty.

Types

type BoostRequestManager

type BoostRequestManager struct {
	// contains filtered or unexported fields
}

func NewBoostRequestManager

func NewBoostRequestManager(
	discord *discordgo.Session,
	repo repository.Repository,
	bundle *i18n.Bundle,
	messenger *messenger.BoostRequestMessenger,
) *BoostRequestManager

func (*BoostRequestManager) AddAdvertiserToBoostRequest

func (brm *BoostRequestManager) AddAdvertiserToBoostRequest(br *repository.BoostRequest, userID string) (err error)

func (*BoostRequestManager) CancelAutoSignup

func (brm *BoostRequestManager) CancelAutoSignup(guildID, userID string) error

func (*BoostRequestManager) CancelBoostRequest

func (brm *BoostRequestManager) CancelBoostRequest(br *repository.BoostRequest) error

func (*BoostRequestManager) CreateBoostRequest

func (brm *BoostRequestManager) CreateBoostRequest(
	brc *repository.BoostRequestChannel,
	brPartial *BoostRequestPartial,
) (*repository.BoostRequest, error)

func (*BoostRequestManager) Destroy

func (brm *BoostRequestManager) Destroy()

func (*BoostRequestManager) EnableAutoSignup

func (brm *BoostRequestManager) EnableAutoSignup(guildID, userID string, duration time.Duration) error

func (*BoostRequestManager) GetBestRolePrivileges

func (brm *BoostRequestManager) GetBestRolePrivileges(guildID string, roles []string) *repository.AdvertiserPrivileges

Best is defined as the role with the highest weight

func (*BoostRequestManager) IsAdvertiserSignedUpForBoostRequest

func (brm *BoostRequestManager) IsAdvertiserSignedUpForBoostRequest(br *repository.BoostRequest, userID string) bool

func (*BoostRequestManager) LoadBoostRequests

func (brm *BoostRequestManager) LoadBoostRequests()

func (*BoostRequestManager) RemoveAdvertiserFromBoostRequest

func (brm *BoostRequestManager) RemoveAdvertiserFromBoostRequest(br *repository.BoostRequest, userID string) (removed bool)

func (*BoostRequestManager) StealBoostRequest

func (brm *BoostRequestManager) StealBoostRequest(br *repository.BoostRequest, userID string) (ok, usedCredits bool)

type BoostRequestPartial

type BoostRequestPartial struct {
	GuildID                string
	BackendChannelID       string
	RequesterID            string
	Message                string
	EmbedFields            []*repository.MessageEmbedField
	PreferredAdvertiserIDs map[string]struct{}
	BackendMessageID       string
	Price                  int64
	NameVisibility         repository.NameVisibilitySetting
	CollectUsersOnly       bool
}

func FromModelBoostRequestPartial

func FromModelBoostRequestPartial(br *models.BoostRequestPartial) (*BoostRequestPartial, error)

type BoostRequestSignupError

type BoostRequestSignupError struct {
	// contains filtered or unexported fields
}

func (*BoostRequestSignupError) Error

func (e *BoostRequestSignupError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL