added template for spam posts, added spam filter, added new js to redirect
This commit is contained in:
19
utils/timed_clear.go
Normal file
19
utils/timed_clear.go
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user