test
This commit is contained in:
parent
2002ea4c3f
commit
a1b3fff0e8
4
bot.go
4
bot.go
@ -303,7 +303,9 @@ func botTimer(m *tb.Message) {
|
|||||||
TGCmdQueue <- c
|
TGCmdQueue <- c
|
||||||
} else {
|
} else {
|
||||||
p := JobPayloadMsgClient{
|
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)
|
b, _ := json.Marshal(p)
|
||||||
t := time.Now().Add(d)
|
t := time.Now().Add(d)
|
||||||
|
4
def.go
4
def.go
@ -218,7 +218,9 @@ type JobPayloadSetDone struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type JobPayloadMsgClient struct {
|
type JobPayloadMsgClient struct {
|
||||||
Msg string `json:"msg"`
|
Text string `json:"msg"`
|
||||||
|
MsgID64 int64 `json:"msg_id"`
|
||||||
|
ChatID64 int64 `json:"chat_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
9
job.go
9
job.go
@ -367,7 +367,14 @@ func jobMsgClient(j Job) {
|
|||||||
logOnError(err, "jobMsgClient : Unmarshal payload")
|
logOnError(err, "jobMsgClient : Unmarshal payload")
|
||||||
|
|
||||||
if err == nil {
|
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)
|
err = setJobDone(j.ID64)
|
||||||
|
Loading…
Reference in New Issue
Block a user