This commit is contained in:
shoopea 2019-05-11 13:16:29 +08:00
parent d46f9d91d6
commit 5dbe827afb

7
bot.go
View File

@ -69,7 +69,6 @@ func botText(m *tb.Message) {
}
func botMsgRescan(m *tb.Message) (string, error) {
var q string
fmt.Println("botRescanMsg :", m.Text)
if !m.Private() {
fmt.Println("botRescanMsg : !m.Private()")
@ -77,9 +76,8 @@ func botMsgRescan(m *tb.Message) (string, error) {
}
r := regexp.MustCompile("^[0-9]+$")
if r.MatchString(m.Payload) {
fmt.Sprintf(q, "SELECT o.id from obj o where o.id = %s and o.obj_type_id = %d and o.obj_sub_type_id = %d;", m.Payload, objTypeMessage, objSubTypeMessageUnknown)
p := JobPayloadRescanMsg{
Query: q,
Query: fmt.Sprintf(q, "SELECT o.id from obj o where o.id = %s and o.obj_type_id = %d and o.obj_sub_type_id = %d;", m.Payload, objTypeMessage, objSubTypeMessageUnknown),
}
b, _ := json.Marshal(p)
log.Printf("botMsgRescan : query : %s\n", q)
@ -95,9 +93,8 @@ func botMsgRescan(m *tb.Message) (string, error) {
}
r = regexp.MustCompile("^all$")
if r.MatchString(m.Payload) {
fmt.Sprintf(q, "SELECT o.id from obj o where o.obj_type_id = %d and o.obj_sub_type_id = %d;", objTypeMessage, objSubTypeMessageUnknown)
p := JobPayloadRescanMsg{
Query: q,
Query: fmt.Sprintf("SELECT o.id from obj o where o.obj_type_id = %d and o.obj_sub_type_id = %d;", objTypeMessage, objSubTypeMessageUnknown),
}
b, _ := json.Marshal(p)
log.Printf("botMsgRescan : query : %s\n", q)