antispam

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL