Skip to content

Commit

Permalink
Add set command to help
Browse files Browse the repository at this point in the history
  • Loading branch information
bahner committed Feb 29, 2024
1 parent 61b7ace commit 66985de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ui/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ func (ui *ChatUI) handleSetBroadcastCommand(args []string) {

switch toggle {
case "on":
ui.subscribeBroadcasts()
ui.displaySystemMessage("Broadcasts are now on")
go ui.subscribeBroadcasts()
ui.displaySystemMessage("Broadcast channel is on")
case "off":
if ui.broadcastCancel != nil {
ui.broadcastCancel()
ui.displaySystemMessage("Broadcasts are now off")
ui.displaySystemMessage("Broadcast channel is off")
}
default:
ui.handleHelpSetBroadcastCommand(args)
Expand Down
3 changes: 3 additions & 0 deletions ui/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func (ui *ChatUI) handleHelpCommands(args []string) {
ui.displaySystemMessage("/help quit")
ui.displaySystemMessage("/help refresh")
ui.displaySystemMessage("/help resolve")
ui.displaySystemMessage("/help set")
ui.displaySystemMessage("/help status")
ui.displaySystemMessage("/help whereis")
ui.displaySystemMessage("/help")
Expand All @@ -50,6 +51,8 @@ func (ui *ChatUI) handleHelpCommands(args []string) {
ui.handleHelpRefreshCommand(args)
case "resolve":
ui.handleHelpResolveCommand(args)
case "set":
ui.handleHelpSetCommands(args)
case "status":
ui.handleHelpStatusCommands(args)
case "whereis":
Expand Down
4 changes: 2 additions & 2 deletions ui/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ func (ui *ChatUI) handleSetCommand(args []string) {
ui.handleSetBroadcastCommand(args)
}
} else {
ui.handleHelpSetCommand(args)
ui.handleHelpSetCommands(args)
}

}

func (ui *ChatUI) handleHelpSetCommand(args []string) {
func (ui *ChatUI) handleHelpSetCommands(args []string) {
ui.displaySystemMessage("Usage: /set broadcast on|off")
ui.displaySystemMessage("For now toggles broadcast messages on and off")
}

0 comments on commit 66985de

Please sign in to comment.