Documentation
¶
Index ¶
- type Provider
- type Service
- func (k *Service) ApplyPenalty(guildID, userID string) (err error)
- func (k *Service) CheckAndUpdate(guildID, executorID string, object *discordgo.User, value int) (ok bool, err error)
- func (k *Service) GetState(guildID string) (ok bool, err error)
- func (k *Service) IsBlockListed(guildID, userID string) (isBlocklisted bool, err error)
- func (k *Service) Update(guildID, userID, executorID string, value int) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { GetState(guildID string) (ok bool, err error) IsBlockListed(guildID, userID string) (isBlocklisted bool, err error) Update(guildID, userID, executorID string, value int) (err error) ApplyPenalty(guildID, userID string) (err error) CheckAndUpdate(guildID, executorID string, object *discordgo.User, value int) (ok bool, err error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides functionalities to check karma state, karma blocklist and alter karma of a user.
func NewKarmaService ¶
func NewKarmaService(container di.Container) (k *Service)
NewKarmaService initializes a new Service instance.
func (*Service) ApplyPenalty ¶
func (*Service) CheckAndUpdate ¶
func (k *Service) CheckAndUpdate(guildID, executorID string, object *discordgo.User, value int) (ok bool, err error)
CheckAndUpdate is shorthand for GetState, IsBlockListed and Update in one single pipe.
func (*Service) GetState ¶
GetState returns the current enabled/disabled state of the karma system on the specified guild.
func (*Service) IsBlockListed ¶
IsBlockListed returns true if the passed user on the specified guild is blocked from gaining or giving karma.
Click to show internal directories.
Click to hide internal directories.