update
This commit is contained in:
@@ -2,12 +2,37 @@ package core
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/cdle/sillyGirl/im"
|
"github.com/cdle/sillyGirl/im"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
go func() {
|
||||||
|
v := sillyGirl.Get("rebootInfo")
|
||||||
|
if v != "" {
|
||||||
|
vv := strings.Split(v, " ")
|
||||||
|
tp, cd, ud := vv[0], Int(vv[1]), Int(vv[2])
|
||||||
|
msg := name() + "重启完成。"
|
||||||
|
if cd == 0 {
|
||||||
|
Push(tp, ud, msg)
|
||||||
|
} else {
|
||||||
|
for i := 0; i < 10; i++ {
|
||||||
|
if push, ok := GroupPushs[tp]; ok {
|
||||||
|
push(cd, ud, msg)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sillyGirl.Set("rebootInfo", "")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
func initSys() {
|
func initSys() {
|
||||||
AddCommand("", []Function{
|
AddCommand("", []Function{
|
||||||
{
|
{
|
||||||
@@ -60,6 +85,7 @@ func initSys() {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
s.Reply(name() + "编译程序完毕。")
|
s.Reply(name() + "编译程序完毕。")
|
||||||
|
sillyGirl.Set("rebootInfo", fmt.Sprintf("%v %v %v", s.GetImType(), s.GetChatID(), s.GetUserID()))
|
||||||
Daemon()
|
Daemon()
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user