This commit is contained in:
cdle
2021-09-26 16:07:17 +08:00
parent ed012cee44
commit 12abea31a8
4 changed files with 19 additions and 40 deletions
+16 -2
View File
@@ -1,7 +1,9 @@
package core
import (
"bufio"
"os"
"regexp"
"time"
)
@@ -16,9 +18,21 @@ func init() {
}
}
initStore()
ReadYaml(ExecPath+"/conf/", &Config, "https://raw.githubusercontent.com/cdle/sillyGirl/main/conf/demo_config.yaml")
InitReplies()
initToHandleMessage()
InitReplies()
file, err := os.Open(ExecPath + "/conf/sets.conf")
if err == nil {
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := scanner.Text()
if regexp.MustCompile(`^set`).MatchString(line) {
Senders <- &Faker{
Message: line,
}
}
}
file.Close()
}
initSys()
Duration = time.Duration(sillyGirl.GetInt("duration", 5)) * time.Second
}