first commit

This commit is contained in:
cdle
2023-06-01 08:41:54 +08:00
parent 61b0e99833
commit d253ed8d5b
80 changed files with 14245 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
package core
import (
"os"
"strings"
"time"
"github.com/cdle/sillyplus/utils"
)
func initReboot() {
go func() {
data, _ := os.ReadFile(utils.ExecPath + "/rebootInfo")
if v := string(data); v != "" {
defer os.RemoveAll(utils.ExecPath + "/rebootInfo")
vv := strings.Split(v, " ")
tp, cd, ud := vv[0], vv[1], vv[2]
if tp == "fake" {
return
}
msg := "重启完成。"
for i := 0; i < 10; i++ {
dapter, _ := GetAdapter(tp, "")
if dapter != nil {
break
}
dapter.Push(Message{
USER_ID: ud,
CHAT_ID: cd,
CONETNT: msg,
})
time.Sleep(time.Second)
}
}
}()
}