From bd9dca976616239186d5d76bd60ddc3edadd870a Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Thu, 27 Jan 2022 18:53:56 -0700 Subject: [PATCH] remove unwanted from help, only print !zip or !state as configured --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 455e72c..43184a3 100644 --- a/main.go +++ b/main.go @@ -82,7 +82,11 @@ func matrixrecv() error { if !printed { if _, err := db.Get(key); err == storage.ErrNotFound { logtr.Debugf("sending help") - help := fmt.Sprintf("commands:\n...`!help` print this help\n...`!zip 27006 84058` to set zip codes for self\n...`!state nc NC nC Nc` set states for self\n...`!available 2022-12-31` set date self is available for work\n\nrun a command for someone else: `!state ga @caleb`") + locationHelp := "`!state nc NC nC Nc` set states for self" + if config.Get().Brokers.UseZips { + locationHelp = "`!zip 27006 84058` to set zip codes for self" + } + help := fmt.Sprintf("commands:\n...`!help` print this help\n...%s\n\nrun a command for someone else: `!zip 2022-12-31 @caleb`", locationHelp) if err := sender.Send(help); err != nil { logtr.Errorf("failed to send help: %v", err) } else {