mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 02:12:33 +00:00
refactor: handle slash commands in a separate function
* quit gorc when "/quit" is sent * move tea commands into their own package * other small fixes
This commit is contained in:
@@ -20,6 +20,8 @@ import (
|
||||
"github.com/charmbracelet/bubbles/textinput"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
|
||||
"github.com/illusionman1212/gorc/cmds"
|
||||
)
|
||||
|
||||
type InputState struct {
|
||||
@@ -51,7 +53,7 @@ func (s InputState) Update(msg tea.Msg) (InputState, tea.Cmd) {
|
||||
|
||||
s.Input.Reset()
|
||||
|
||||
return s, s.SendingPrivMsg(value)
|
||||
return s, cmds.SendPrivMsg(value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user