From a1b3fff0e83d3dde9a82baccf5514fe69dda50b8 Mon Sep 17 00:00:00 2001 From: shoopea Date: Mon, 3 Jun 2019 09:01:18 +0800 Subject: [PATCH] test --- bot.go | 4 +++- def.go | 4 +++- job.go | 9 ++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bot.go b/bot.go index ff07920..65d69a9 100644 --- a/bot.go +++ b/bot.go @@ -303,7 +303,9 @@ func botTimer(m *tb.Message) { TGCmdQueue <- c } else { p := JobPayloadMsgClient{ - Msg: r.ReplaceAllString(m.Payload, "${Msg}"), + Text: r.ReplaceAllString(m.Payload, "${Msg}"), + MsgID64: int64(m.ID), + ChatID64: m.Chat.ID, } b, _ := json.Marshal(p) t := time.Now().Add(d) diff --git a/def.go b/def.go index 82957d2..1082db3 100644 --- a/def.go +++ b/def.go @@ -218,7 +218,9 @@ type JobPayloadSetDone struct { } type JobPayloadMsgClient struct { - Msg string `json:"msg"` + Text string `json:"msg"` + MsgID64 int64 `json:"msg_id"` + ChatID64 int64 `json:"chat_id"` } const ( diff --git a/job.go b/job.go index 2516e55..4a98c18 100644 --- a/job.go +++ b/job.go @@ -367,7 +367,14 @@ func jobMsgClient(j Job) { logOnError(err, "jobMsgClient : Unmarshal payload") if err == nil { - clientSendCWMsg(j.UserID64, p.Msg) + clientSendCWMsg(j.UserID64, p.Text) + m := TGCommand{ + Type: commandReplyMsg, + Text: "Message sent.", + FromMsgID64: p.MsgID64, + FromChatID64: p.ChatID64, + } + TGCmdQueue <- m } err = setJobDone(j.ID64)