fix msg rescan all

This commit is contained in:
shoopea 2020-02-06 10:26:24 +08:00
parent 87ceefaff4
commit 02d27ac6bd

2
bot.go
View File

@ -425,7 +425,7 @@ func botMsgRescanAll(m *tb.Message) {
if len(m.Payload) > 0 {
r := regexp.MustCompile("^\"(?P<Filter>(.*))\"$")
if r.MatchString(m.Payload) {
p.Query = fmt.Sprintf("SELECT o.id FROM obj o, obj_msg om WHERE o.obj_type_id = %d AND o.obj_sub_type_id = %d AND om.obj_id = o.id AND om.text like '%s' ORDER BY o.id ASC;", cacheObjType[`msg`], cacheObjSubType[`msg`], r.ReplaceAllString(m.Text, "${Filter}"))
p.Query = fmt.Sprintf("SELECT o.id FROM obj o, obj_msg om WHERE o.obj_type_id = %d AND o.obj_sub_type_id = %d AND om.obj_id = o.id AND om.text like '%s' ORDER BY o.id ASC;", cacheObjType[`msg`], cacheObjSubType[`msg`], r.ReplaceAllString(m.Payload, "${Filter}"))
} else {
c := TGCommand{
Type: commandReplyMsg,