added template for spam posts, added spam filter, added new js to redirect

This commit is contained in:
rawleyIfowler
2022-02-26 10:15:57 -06:00
parent 7d8faeed62
commit b1c76c2094
4 changed files with 53 additions and 4 deletions

19
utils/timed_clear.go Normal file
View File

@@ -0,0 +1,19 @@
package utils
import (
"strconv"
"time"
)
func TimedClearMap(m *map[string]uint, timer uint) {
for {
t, err := time.ParseDuration(strconv.FormatUint(uint64(timer), 10) + "ms")
if err != nil {
panic("Something went wrong initializing time!!")
}
time.Sleep(t)
for key := range *m {
delete(*m, key)
}
}
}