This commit is contained in:
shoopea 2019-06-03 09:01:18 +08:00
parent 2002ea4c3f
commit a1b3fff0e8
3 changed files with 14 additions and 3 deletions

4
bot.go
View File

@ -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)

4
def.go
View File

@ -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 (

9
job.go
View File

@ -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)