Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MsgIncrementKarma prints the results of ?++ thing MsgIncrementKarma = "%v has been upvoted. %v now has %d karma." // MsgDecrementKarma prints the results of ?-- thing MsgDecrementKarma = "%v has been downvoted. %v now has %d karma." )
View Source
const ( // MsgHelpKarmaIncrement is help text for ?++ MsgHelpKarmaIncrement = "Type ?++ <target> to add a single unit of karma to a target's karma score" // MsgHelpKarmaDecrement is help text for ?-- MsgHelpKarmaDecrement = "Type ?-- <target> to deduct a single unit of karma from a target's karma score" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor increments or decrements karma and prints the results to the user.
func NewExecutor ¶
func NewExecutor(modelHelper *ModelHelper) *Executor
NewExecutor works as advertised.
func (*Executor) Execute ¶
Execute attempts to add karma to the total already in memory, or creates a new record if it was not found.
func (*Executor) PublicOnly ¶
PublicOnly returns whether the executor should be intercepted in a private channel.
type Feature ¶
type Feature struct {
// contains filtered or unexported fields
}
Feature allows crbot to record changes in karma
func NewFeature ¶
NewFeature returns a new Feature.
func (*Feature) CommandInterceptors ¶
func (f *Feature) CommandInterceptors() []feature.CommandInterceptor
CommandInterceptors returns nothing.
func (*Feature) FallbackParser ¶
FallbackParser returns nil
func (*Feature) OnInitialLoad ¶
func (f *Feature) OnInitialLoad(s api.DiscordSession) error
OnInitialLoad does nothing.
type ModelHelper ¶
type ModelHelper struct {
// contains filtered or unexported fields
}
ModelHelper provides helpers for working with karma storage.
func NewModelHelper ¶
func NewModelHelper(karmaMap stringmap.StringMap) *ModelHelper
NewModelHelper works as advertised.
type Parser ¶
type Parser struct { // The message that the parser looks for. Message string // Whether this message is incrementing or decrementing karma Increment bool }
Parser parses ?++ and ?-- commands
Click to show internal directories.
Click to hide internal directories.