From 5dbe827afb51e8ff18bdd904bfa5452eadf124fa Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 11 May 2019 13:16:29 +0800 Subject: [PATCH] test --- bot.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bot.go b/bot.go index 890fccb..afde929 100644 --- a/bot.go +++ b/bot.go @@ -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)