Skip to content

Commit 1aff794

Browse files
authored
fix sleep logging message, bot token and channel required (#12)
1 parent 3b6c5ce commit 1aff794

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

cmd/motion-poll/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func main() {
6868
if ssUrl != "" && opts.SlackBotToken != "token" && opts.SlackChannelID != "" {
6969
getAndUploadSnapshot(ssUrl, opts.SlackChannelID, *slackClient)
7070
}
71+
fmt.Printf(utils.SleepTemplate, opts.CooldownTimer)
7172
time.Sleep(time.Duration(opts.CooldownTimer) * time.Second)
7273
}
7374
time.Sleep(1 * time.Second)

pkg/model/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ type BasicParameters struct {
88
}
99

1010
type SlackParameters struct {
11-
SlackChannelID string `short:"c" long:"channel-id" description:"The ID of the slack channel where snapshots will be posted if provided" required:"false"`
12-
SlackBotToken string `short:"b" long:"bot-token" description:"The token for the slack bot that will upload a snapshot if provided" required:"false" default:"token"`
11+
SlackChannelID string `short:"c" long:"channel-id" description:"The ID of the slack channel where snapshots will be posted if provided" required:"true"`
12+
SlackBotToken string `short:"b" long:"bot-token" description:"The token for the slack bot that will upload a snapshot if provided" required:"true"`
1313
MessageTemplate string `short:"m" long:"message-template" description:"The message template in JSON format to use for notifications instead of the default one" required:"false" default:"Motion detected at %s"`
1414
}
1515

pkg/utils/logTemplates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package utils
22

33
const ArgParseError = "Error while parsing CLI args %v\n"
44

5-
const SleepTemplate = "Sleeping for %d minutes\n"
5+
const SleepTemplate = "Sleeping for %d seconds\n"
66

77
const ConnectionOK = "Connected to device %s\n"
88

0 commit comments

Comments
 (0)