Skip to content

Commit

Permalink
overwrite incorrect legacy data (#1746)
Browse files Browse the repository at this point in the history
Co-authored-by: Ashish <[email protected]>
  • Loading branch information
ashishjh-bst and ashishjh-bst authored Oct 24, 2024
1 parent 4e8d1ac commit d137547
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions automod_legacy/automod.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ func GetConfig(guildID int64) (config *Config, err error) {
if config == nil {
config = DefaultConfig()
}
// This is needed for legacy reason
// because the validation for this is via a common middleware which may break a heck lot of things if tinkered with.
if config.Spam.NumMessages == 0 {
config.Spam.NumMessages = 1
}
if config.Spam.Within == 0 {
config.Spam.Within = 5
}
if config.Mention.Treshold == 0 {
config.Mention.Treshold = 1
}
return
}

Expand Down

0 comments on commit d137547

Please sign in to comment.