Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetParentBot ¶
SetParentBot sets the internal global reference to an instance of "github.com/go-chat-bot/bot". This reference is used to send messages outside of the registered callback (leet). The bot including this module must call this before using this module.
Types ¶
type BonusConfig ¶
type BonusConfig struct { SubString string // string to search for in timestamp Greeting string // Message from bot to user upon bonus hit StepPoints int // points to multiply substring position with NoStepPoints int // points to return for match when UseStep == false PrefixChar rune // the char required as only prefix for max bonus, e.g. '0' UseStep bool // if to multiply points for each position to the right in string // contains filtered or unexported fields }
type BonusConfigs ¶
type BonusConfigs []BonusConfig
type BonusReturn ¶
func (BonusReturn) String ¶
func (br BonusReturn) String() string
type BonusReturns ¶
type BonusReturns []BonusReturn
func (BonusReturns) String ¶
func (brs BonusReturns) String() string
func (BonusReturns) TotalBonus ¶
func (brs BonusReturns) TotalBonus() int
type Channel ¶
type Channel struct { Users UserMap `json:"users"` // string key is nick Name string `json:"channel_name,omitempty"` // we need to duplicate this from the parent map key, so that the instance knows its own name InspectionTax float64 `json:"inspection_tax"` // percentage, but no check if outside of 0-100 OvershootTax int `json:"overshoot_tax"` // interval for how much to deduct if user scores past target InspectAlways bool `json:"inspect_always"` // if false, only inspect if random value between 0 and 6 matches current weekday TaxLoners bool `json:"tax_loners"` // If to inspect and tax when only one contestant in a round PostTaxFail bool `json:"post_tax_fail"` // If to post to channel why taxation does NOT happen // contains filtered or unexported fields }
type ScoreTracker ¶
type User ¶
type User struct { LastEntry time.Time `json:"last_entry"` // time of last !1337 post that resulted in a score, positive or negative BestEntry time.Time `json:"best_entry"` // tightest to 1337, or whatever... Nick string `json:"nick"` // duplicate of map key, but we need to have it here as well sometimes Taxes ScoreTracker `json:"taxes"` // hos much tax over time Bonuses ScoreTracker `json:"bonuses"` // how much bonuses over time Misses ScoreTracker `json:"misses"` // how many times have the user been early or late Points int `json:"score"` // current points total Locked bool `json:"locked"` // true if the user has reached the target limit // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.