remove unwanted from help, only print !zip or !state as configured

v0.5.0
Bel LaPointe 2022-01-27 18:53:56 -07:00
parent 56f7d093ef
commit bd9dca9766
1 changed files with 5 additions and 1 deletions

View File

@ -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 {