update
This commit is contained in:
+7
-2
@@ -5,6 +5,7 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/beego/beego/v2/adapter/logs"
|
||||||
"github.com/cdle/sillyGirl/im"
|
"github.com/cdle/sillyGirl/im"
|
||||||
cron "github.com/robfig/cron/v3"
|
cron "github.com/robfig/cron/v3"
|
||||||
)
|
)
|
||||||
@@ -61,9 +62,13 @@ func AddCommand(prefix string, cmds []Function) {
|
|||||||
}
|
}
|
||||||
functions = append(functions, cmds[j])
|
functions = append(functions, cmds[j])
|
||||||
if cmds[j].Cron != "" {
|
if cmds[j].Cron != "" {
|
||||||
c.AddFunc(cmds[j].Cron, func() {
|
if _, err := c.AddFunc(cmds[j].Cron, func() {
|
||||||
cmds[j].Handle(&im.Faker{})
|
cmds[j].Handle(&im.Faker{})
|
||||||
})
|
}); err != nil {
|
||||||
|
logs.Warn("任务%v添加失败%v", cmds[j].Rules[0], err)
|
||||||
|
} else {
|
||||||
|
logs.Warn("任务%v添加成功", cmds[j].Rules[0])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,9 +185,7 @@ func (sender *Sender) Reply(msgs ...interface{}) error {
|
|||||||
MSG := bot.GetMessage(id)
|
MSG := bot.GetMessage(id)
|
||||||
bot.Client.RecallGroupMessage(m.GroupCode, MSG["message-id"].(int32), MSG["internal-id"].(int32))
|
bot.Client.RecallGroupMessage(m.GroupCode, MSG["message-id"].(int32), MSG["internal-id"].(int32))
|
||||||
}()
|
}()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user