remove unwanted from help, only print !zip or !state as configured
parent
56f7d093ef
commit
bd9dca9766
6
main.go
6
main.go
|
|
@ -82,7 +82,11 @@ func matrixrecv() error {
|
||||||
if !printed {
|
if !printed {
|
||||||
if _, err := db.Get(key); err == storage.ErrNotFound {
|
if _, err := db.Get(key); err == storage.ErrNotFound {
|
||||||
logtr.Debugf("sending help")
|
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 {
|
if err := sender.Send(help); err != nil {
|
||||||
logtr.Errorf("failed to send help: %v", err)
|
logtr.Errorf("failed to send help: %v", err)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue