Documentation
¶
Index ¶
- Variables
- type BoostRequestManager
- func (brm *BoostRequestManager) AddAdvertiserToBoostRequest(br *repository.BoostRequest, userID string) (err error)
- func (brm *BoostRequestManager) CancelAutoSignup(guildID, userID string) error
- func (brm *BoostRequestManager) CancelBoostRequest(br *repository.BoostRequest) error
- func (brm *BoostRequestManager) CreateBoostRequest(brc *repository.BoostRequestChannel, brPartial *BoostRequestPartial) (*repository.BoostRequest, error)
- func (brm *BoostRequestManager) Destroy()
- func (brm *BoostRequestManager) EnableAutoSignup(guildID, userID string, duration time.Duration) error
- func (brm *BoostRequestManager) GetBestRolePrivileges(guildID string, roles []string) *repository.AdvertiserPrivileges
- func (brm *BoostRequestManager) IsAdvertiserSignedUpForBoostRequest(br *repository.BoostRequest, userID string) bool
- func (brm *BoostRequestManager) LoadBoostRequests()
- func (brm *BoostRequestManager) RemoveAdvertiserFromBoostRequest(br *repository.BoostRequest, userID string) (removed bool)
- func (brm *BoostRequestManager) StealBoostRequest(br *repository.BoostRequest, userID string) (ok, usedCredits bool)
- type BoostRequestPartial
- type BoostRequestSignupError
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
Click to show internal directories.
Click to hide internal directories.