Add message when deferring command for later
This commit is contained in:
@ -88,7 +88,8 @@ func listVehicles(m chat1.MsgSummary) {
|
||||
func deferTime(m chat1.MsgSummary) {
|
||||
parts := strings.Split(m.Content.Text.Body, " ")
|
||||
t := parts[1]
|
||||
m.Content.Text.Body = fmt.Sprintf("!%+v", strings.Join(parts[1:], " "))
|
||||
command := strings.Join(parts[1:], " ")
|
||||
m.Content.Text.Body = fmt.Sprintf("!%+v", command)
|
||||
timer, err := time.ParseDuration(t)
|
||||
if err != nil {
|
||||
tracker := uuid.NewString()
|
||||
@ -96,6 +97,7 @@ func deferTime(m chat1.MsgSummary) {
|
||||
log.LogError("%+v: %+v", tracker, err)
|
||||
return
|
||||
}
|
||||
k.SendMessageByConvID(m.ConvID, fmt.Sprintf("I will run %+v at %+v", command, time.Now().Add(timer)))
|
||||
time.Sleep(timer)
|
||||
handleChat(m)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user