test
This commit is contained in:
parent
de41d0196b
commit
06b697067c
20
bot.go
20
bot.go
@ -284,18 +284,18 @@ func botTimer(m *tb.Message) {
|
||||
}
|
||||
TGCmdQueue <- c
|
||||
} else {
|
||||
log.Printf("Timer : Event : %s\n", time.Now().Add(d).Format(time.RFC822))
|
||||
log.Printf("Timer : Event : %s\n", time.Now().Add(d).Format(time.RFC850))
|
||||
c := TGCommand{
|
||||
Type: commandSendMsg,
|
||||
Text: "", r.ReplaceAllString(m.Payload, "${Msg}"),
|
||||
FromUserID64: m.Chat.ID,
|
||||
ToChatID64: userID64ChtWrsBot,
|
||||
}
|
||||
b, _ := json.Marshal(c)
|
||||
err := createJob(objSubTypeJobMsgClient, objJobPriority, int64(m.Sender.ID), time.Now(), b)
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
c := TGCommand{
|
||||
Type: commandReplyMsg,
|
||||
Text: res,
|
||||
FromMsgID64: int64(m.ID),
|
||||
FromChatID64: m.Chat.ID,
|
||||
}
|
||||
TGCmdQueue <- c
|
||||
*/
|
||||
|
||||
return
|
||||
}
|
||||
|
1
def.go
1
def.go
@ -252,6 +252,7 @@ const (
|
||||
objSubTypeJobGStock = 605
|
||||
objSubTypeJobRescanMsg = 606
|
||||
objSubTypeJobSetJobDone = 607
|
||||
objSubTypeJobMsgClient = 608
|
||||
objSubTypeItemResource = 701
|
||||
objSubTypeItemAlch = 702
|
||||
objSubTypeItemMisc = 703
|
||||
|
15
job.go
15
job.go
@ -120,3 +120,18 @@ func jobPillage(j Job) {
|
||||
logOnError(err, "jobSetDone : setJobDone")
|
||||
return
|
||||
}
|
||||
|
||||
func jobMsgClient(j Job) {
|
||||
var c TGCommand
|
||||
err := setJobStart(j.ID64)
|
||||
logOnError(err, "jobMsgClient : setJobStart")
|
||||
|
||||
err = json.Unmarshal(j.Payload, &c)
|
||||
logOnError(err, "jobMsgClient : Unmarshal payload")
|
||||
|
||||
MQTGCmdQueue <- c
|
||||
|
||||
err := setJobDone(j.ID64)
|
||||
logOnError(err, "joMsgClient : setJobDone")
|
||||
return
|
||||
}
|
||||
|
@ -271,6 +271,8 @@ func SQLJobWorker(id int) {
|
||||
jobSetDone(j)
|
||||
case objSubTypeJobPillage:
|
||||
jobPillage(j)
|
||||
case objSubTypeJobMsgClient:
|
||||
jobMsgClient(j)
|
||||
default:
|
||||
log.Printf("SQLJobWorker["+strconv.Itoa(id)+"] : No handler for job type #%d.\n", j.JobTypeID)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user