discover the existence of strings.Cut

trunk
vilmibm 2022-12-29 19:41:11 -05:00
parent 6d6e6d5726
commit 8a56e79f5d
1 changed files with 1 additions and 7 deletions

View File

@ -60,13 +60,7 @@ func (cs *ClientState) HandleInput(input string) error {
var verb string
rest := input
if strings.HasPrefix(input, "/") {
// TODO this is def broken lol
input = input[1:]
parts := strings.SplitN(input, " ", 1)
verb = parts[0]
if len(parts) > 1 {
rest = parts[1]
}
verb, rest, _ = strings.Cut(input[1:], " ")
} else {
verb = "say"
}