This commit is contained in:
cdle
2021-10-09 18:26:10 +08:00
parent 095162d90c
commit c701f1ddd4
4 changed files with 17 additions and 12 deletions
+4 -4
View File
@@ -54,12 +54,12 @@ func init() {
logs.Warn("监听telegram机器人失败:%v", err)
return
}
core.Pushs["tg"] = func(i int, s string) {
b.Send(&tb.User{ID: i}, s)
core.Pushs["tg"] = func(i interface{}, s string) {
b.Send(&tb.User{ID: core.Int(i)}, s)
}
core.GroupPushs["tg"] = func(i, j int, s string) {
core.GroupPushs["tg"] = func(i, _ interface{}, s string) {
paths := []string{}
ct := &tb.Chat{ID: int64(i)}
ct := &tb.Chat{ID: core.Int64(i)}
for _, v := range regexp.MustCompile(`\[CQ:image,file=([^\[\]]+)\]`).FindAllStringSubmatch(s, -1) {
paths = append(paths, core.ExecPath+"/data/images/"+v[1])
s = strings.Replace(s, fmt.Sprintf(`[CQ:image,file=%s]`, v[1]), "", -1)