From 31a7402c82df03e212dc4852a12f4da1a0f98c43 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Tue, 6 Jul 2021 19:33:05 -0400 Subject: [PATCH] Add reminder for running command --- commands.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index ca3d5a6..6fbc74b 100644 --- a/commands.go +++ b/commands.go @@ -88,6 +88,7 @@ func listVehicles(m chat1.MsgSummary) { func deferTime(m chat1.MsgSummary) { parts := strings.Split(m.Content.Text.Body, " ") t := parts[1] + start := time.Now() command := strings.Join(parts[2:], " ") m.Content.Text.Body = fmt.Sprintf("!%+v", command) timer, err := time.ParseDuration(t) @@ -97,8 +98,9 @@ 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).Format("Jan _2 15:04:05"))) + k.SendMessageByConvID(m.ConvID, fmt.Sprintf("I will run `%+v` at %+v", command, time.Now().Add(timer).Format("Jan _2 15:04:05"))) time.Sleep(timer) + k.SendMessageByConvID(m.ConvID, fmt.Sprintf("Running `%+v` from %+v", command, start.Format("Jan _2 15:04:05"))) handleChat(m) }