Added input handling and m_roleplay client-side handlers (...)

- 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
This commit is contained in:
2018-06-28 12:11:12 +02:00
parent c17a5e59bc
commit 308129bdf0
11 changed files with 383 additions and 57 deletions
+17
View File
@@ -0,0 +1,17 @@
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:]
}