diff --git a/def.go b/def.go index cc0ea7a..03ba699 100644 --- a/def.go +++ b/def.go @@ -214,7 +214,8 @@ type JobPayloadMsgRefresh struct { } type JobPayloadPillage struct { - ObjID64 int64 `json:"obj_id"` + ObjID64 int64 `json:"obj_id"` + Date time.Time `json:"date"` } type JobPayloadTribute struct { diff --git a/job.go b/job.go index 386ddcb..e1f832f 100644 --- a/job.go +++ b/job.go @@ -351,6 +351,17 @@ func jobPillage(j Job) { return } + // is the job outdated now ? + if r.Date.Before(time.Now().Sub(3*time.Minute + 30*time.Second)) { + s := TGCommand{ + Type: commandSendMsg, + Text: fmt.Sprintf("Pillage interception expired"), + ToUserID64: j.UserID64, + } + TGCmdQueue <- s + return + } + s := TGCommand{ Type: commandSendMsg, Text: fmt.Sprintf("No outcome for the pillage yet"),