Documentation ¶
Index ¶
- Variables
- func CheckMessage(evt *eventsystem.EventData, m *discordgo.Message) bool
- func CheckMessageForBadInvites(msg *discordgo.Message) (containsBadInvites bool)
- func CommandsMessageFilterFunc(evt *eventsystem.EventData, msg *discordgo.Message) bool
- func ExtraPostMW(inner http.Handler) http.Handler
- func HandleAutomod(w http.ResponseWriter, r *http.Request) interface{}
- func HandleMessageUpdate(evt *eventsystem.EventData)
- func HandleUpdateAutomodRules(event *pubsub.Event)
- func KeyConfig(gID int64) string
- func KeyEnabled(gID int64) string
- func KeyViolations(gID, uID int64, violation string) string
- func RegisterPlugin()
- type BaseRule
- func (r BaseRule) GetMuteDuration() int
- func (r BaseRule) IgnoreChannelsParsed() []int64
- func (r BaseRule) IgnoreRoleInt() int64
- func (r BaseRule) PushViolation(key string) (p Punishment, err error)
- func (r BaseRule) ShouldIgnore(cs *dstate.ChannelState, evt *discordgo.Message, ms *dstate.MemberState) bool
- type Condition
- type Config
- type GeneralForm
- type GuildInvites
- type InviteRule
- type LinksRule
- type MentionRule
- type Plugin
- func (p *Plugin) AllFeatureFlags() []string
- func (p *Plugin) BotInit()
- func (p *Plugin) InitWeb()
- func (p *Plugin) LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
- func (p *Plugin) Name() string
- func (p *Plugin) PluginInfo() *common.PluginInfo
- func (p *Plugin) SysName() string
- func (p *Plugin) UpdateFeatureFlags(guildID int64) ([]string, error)
- type Punishment
- type Rule
- type SitesRule
- type SpamRule
- type WordsRule
Constants ¶
This section is empty.
Variables ¶
View Source
var BuiltinSwearWords = map[string]bool{ "anal": true, "anus": true, "arse": true, "ass": true, "b1tch": true, "ballsack": true, "bastard": true, "bitch": true, "biatch": true, "blowjob": true, "bollock": true, "bollok": true, "boner": true, "boob": true, "boobs": true, "buttplug": true, "clitoris": true, "cock": true, "cum": true, "cunt": true, "dick": true, "dildo": true, "dyke": true, "erection": true, "fag": true, "faggot": true, "feck": true, "fellate": true, "fellatio": true, "felching": true, "fuck": true, "fucks": true, "fudgepacker": true, "genitals": true, "hell": true, "jerk": true, "jizz": true, "knobend": true, "labia": true, "masturbate": true, "muff": true, "nigger": true, "nigga": true, "penis": true, "piss": true, "poop": true, "pube": true, "pussy": true, "scrotum": true, "sex": true, "shit": true, "sh1t": true, "slut": true, "smegma": true, "spunk": true, "tit": true, "tranny": true, "trannies": true, "tosser": true, "turd": true, "twat": true, "vagina": true, "wank": true, "whore": true, "tits": true, "titty": true, "asshole": true, "fvck": true, "asshat": true, "pu55y": true, "pen1s": true, }
These words are listed in in alphabethical order.
View Source
var PageHTML string
Functions ¶
func CheckMessage ¶
func CheckMessage(evt *eventsystem.EventData, m *discordgo.Message) bool
func CommandsMessageFilterFunc ¶
func CommandsMessageFilterFunc(evt *eventsystem.EventData, msg *discordgo.Message) bool
func HandleAutomod ¶
func HandleAutomod(w http.ResponseWriter, r *http.Request) interface{}
func HandleMessageUpdate ¶
func HandleMessageUpdate(evt *eventsystem.EventData)
func HandleUpdateAutomodRules ¶
Invalidate the cache when the rules have changed
func KeyViolations ¶
func RegisterPlugin ¶
func RegisterPlugin()
Types ¶
type BaseRule ¶
type BaseRule struct { Enabled bool ViolationsExpire int `valid:"0,44640"` // Execute these punishments after certain number of repeated violaions MuteAfter int `valid:"0,1000"` MuteDuration int `valid:"0,44640"` KickAfter int `valid:"0,1000"` BanAfter int `valid:"0,1000"` IgnoreRole string `valid:"role,true"` IgnoreChannels []string `valid:"channel,false"` }
func (BaseRule) GetMuteDuration ¶
func (BaseRule) IgnoreChannelsParsed ¶
func (BaseRule) IgnoreRoleInt ¶
func (BaseRule) PushViolation ¶
func (r BaseRule) PushViolation(key string) (p Punishment, err error)
func (BaseRule) ShouldIgnore ¶
func (r BaseRule) ShouldIgnore(cs *dstate.ChannelState, evt *discordgo.Message, ms *dstate.MemberState) bool
Returns true if this rule should be ignored
type Config ¶
type Config struct { Enabled bool Spam *SpamRule `valid:"traverse"` Mention *MentionRule `valid:"traverse"` Invite *InviteRule `valid:"traverse"` Links *LinksRule `valid:"traverse"` Sites *SitesRule `valid:"traverse"` Words *WordsRule `valid:"traverse"` }
func CachedGetConfig ¶
CachedGetConfig either retrieves from local application cache or redis
func DefaultConfig ¶ added in v2.46.1
func DefaultConfig() *Config
type GeneralForm ¶
type GeneralForm struct {
Enabled bool
}
type GuildInvites ¶ added in v2.9.0
type GuildInvites struct {
// contains filtered or unexported fields
}
type InviteRule ¶
type InviteRule struct {
BaseRule `valid:"traverse"`
}
func (*InviteRule) Check ¶
func (i *InviteRule) Check(evt *discordgo.Message, cs *dstate.ChannelState) (del bool, punishment Punishment, msg string, err error)
type MentionRule ¶
func (*MentionRule) Check ¶
func (m *MentionRule) Check(evt *discordgo.Message, cs *dstate.ChannelState) (del bool, punishment Punishment, msg string, err error)
type Plugin ¶
type Plugin struct{}
func (*Plugin) AllFeatureFlags ¶
func (*Plugin) LoadServerHomeWidget ¶
func (p *Plugin) LoadServerHomeWidget(w http.ResponseWriter, r *http.Request) (web.TemplateData, error)
func (*Plugin) PluginInfo ¶
func (p *Plugin) PluginInfo() *common.PluginInfo
type Punishment ¶
type Punishment int
const ( PunishNone Punishment = iota PunishMute PunishKick PunishBan )
type Rule ¶
type Rule interface { Check(m *discordgo.Message, cs *dstate.ChannelState) (del bool, punishment Punishment, msg string, err error) ShouldIgnore(cs *dstate.ChannelState, msg *discordgo.Message, m *dstate.MemberState) bool GetMuteDuration() int }
type SitesRule ¶
type SitesRule struct { BaseRule `valid:"traverse"` GoogleSafeBrowsingEnabled bool ScamLinkProtection bool BannedWebsites string `valid:",10000"` // contains filtered or unexported fields }
func (*SitesRule) Check ¶
func (s *SitesRule) Check(evt *discordgo.Message, cs *dstate.ChannelState) (del bool, punishment Punishment, msg string, err error)
func (*SitesRule) GetCompiled ¶
type SpamRule ¶
type SpamRule struct { BaseRule `valid:"traverse"` NumMessages int `valid:"1,1000"` Within int `valid:"1,100"` }
type WordsRule ¶
type WordsRule struct { BaseRule `valid:"traverse"` BuiltinSwearWords bool BannedWords string `valid:",25000"` // contains filtered or unexported fields }
func (*WordsRule) Check ¶
func (w *WordsRule) Check(evt *discordgo.Message, cs *dstate.ChannelState) (del bool, punishment Punishment, msg string, err error)
func (*WordsRule) CheckMessage ¶
func (*WordsRule) GetCompiled ¶
Click to show internal directories.
Click to hide internal directories.