From f27027a34afb4549699f0bb9eb474b2bf4f70fbd Mon Sep 17 00:00:00 2001 From: Jana Gierloff Date: Fri, 3 Apr 2020 11:12:46 +0200 Subject: [PATCH] Fix optional seconds field for cron time --- command/schedule_add.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/command/schedule_add.go b/command/schedule_add.go index 7723f1c..e2ddd68 100644 --- a/command/schedule_add.go +++ b/command/schedule_add.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/tigerteufel85/boggy/client" "github.com/tigerteufel85/boggy/config" - "regexp" "strings" "github.com/nlopes/slack" @@ -86,9 +85,6 @@ func (c *scheduleAdd) Execute(ctx context.Context, b *bot.Bot, eventText string, } time = strings.Join(timeFields, " ") - var re = regexp.MustCompile("^([\\S]+)") - time = re.ReplaceAllString(strings.Trim(time, " "), "0") - if !b.IsValidSchedule(time) { c.slackClient.Respond(event, fmt.Sprintf("I'm sorry, but \"%s\" is not a valid schedule. Please check *@boggy help schedule>* for more information", time)) return true