mirror of
https://github.com/gissleh/irc.git
synced 2026-10-20 16:32:54 +00:00
- Added Client.EmitInput() - Added ircutil.ParseArgAndText for common /msg <target> <message...> type inputs - Added target getters for Event - Added default handling for input events that haven't been killed - Removed handler_debug - Changed timeout for interaction to 2s - Fixed comment typo in event_packet.go
18 lines
389 B
Go
18 lines
389 B
Go
package ircutil
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// ParseArgAndText parses a text like "#Channel stuff and things" into "#Channel"
|
|
// and "stuff and things". This is commonly used for input commands which has
|
|
// no standard
|
|
func ParseArgAndText(s string) (arg, text string) {
|
|
spaceIndex := strings.Index(s, " ")
|
|
if spaceIndex == -1 {
|
|
return s, ""
|
|
}
|
|
|
|
return s[:spaceIndex], s[spaceIndex+1:]
|
|
}
|