Documentation ¶
Index ¶
Constants ¶
View Source
const SpamMax string = "data/spamMax.json"
SpamMax is the path were the bot stores that maximum number of repeated messages before kicking the user
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SpamTracker ¶
type SpamTracker struct {
// contains filtered or unexported fields
}
SpamTracker is the requierd struct for use with the antispam system.
func NewSpamTracker ¶
func NewSpamTracker() *SpamTracker
NewSpamTracker creates the requierd struct for use with the antispam system.
func (*SpamTracker) CheckForSpam ¶
func (s *SpamTracker) CheckForSpam(msg *dg.MessageCreate) (bool, error)
CheckForSpam is used to check if the last `n` messages are the same as the current messag sent by the user.
func (*SpamTracker) Handler ¶
func (s *SpamTracker) Handler(request []string, msg *dg.MessageCreate) (string, error)
Handler handles the execution of the antispam methods
func (*SpamTracker) LoadMax ¶
func (s *SpamTracker) LoadMax(file string) error
LoadMax loads the saved maximum value set by the bot owner
Click to show internal directories.
Click to hide internal directories.