tweak messagelasttensecs

master
Marc 2021-05-31 23:13:55 +01:00
parent 373a31e5b7
commit 15ce404ec8
No known key found for this signature in database
GPG Key ID: 0657563F705ACAAE
1 changed files with 10 additions and 1 deletions

View File

@ -38,6 +38,11 @@ func (o *Overwatch) ProcessMessage(s *discordgo.Session, m interface{}) {
if err != nil {
log.Printf("[!] Error handling Overwatch user stat: %s\n", err.Error())
}
err = o.filterUserMessage(s, m.(*discordgo.MessageCreate))
if err != nil {
log.Printf("[!] Error handling Overwatch user message filter: %s\n", err.Error())
}
break
case *discordgo.GuildMemberAdd:
err := o.handleServerJoin(s, m.(*discordgo.GuildMemberAdd))
@ -48,6 +53,10 @@ func (o *Overwatch) ProcessMessage(s *discordgo.Session, m interface{}) {
}
}
func (o *Overwatch) filterUserMessage(s *discordgo.Session, m *discordgo.MessageCreate) error {
return nil
}
func (o *Overwatch) handleUserStat(s *discordgo.Session, m *discordgo.MessageCreate) error {
userID := m.Author.ID
@ -95,7 +104,7 @@ func (o *Overwatch) Run() {
for range time.Tick(5 * time.Second) {
for _, user := range o.UserMessages {
// load the threshold from the config file, dipshit
if user.MessagesLastTenSecs > 10 {
if user.MessagesLastTenSecs > 20 {
// Set slow mode, kick user? add kick count?
if user.Kicks > 2 {
// ban that sucker