func (e *Event) String() string {
	b := &bytes.Buffer{}
	if len(e.Sender) > 0 {
		b.WriteByte(':')
		b.WriteString(e.Sender)
		b.WriteByte(' ')
	}
	b.WriteString(e.Name)
	lastArg := len(e.Args) - 1
	for i, arg := range e.Args {
		b.WriteByte(' ')
		if lastArg == i && strings.ContainsRune(arg, ' ') {
			b.WriteByte(':')
		}
		b.WriteString(arg)
	}
	return b.String()
}
String turns this back into an IRC style message.
package irc
import (
	"bytes"
	"strings"
	"time"
)
type Event struct {
	Name string `msgpack:"name"`
	Sender string `msgpack:"sender"`
	Args []string `msgpack:"args"`
	Time time.Time `msgpack:"time"`
	NetworkID string `msgpack:"network_id"`
	NetworkInfo *NetworkInfo `msgpack:"-"`
}
func NewEvent(netID string, ni *NetworkInfo, name, sender string,
	args ...string) *Event {
	var setArgs []string
	if len(args) > 0 {
		setArgs = make([]string, len(args))
		copy(setArgs, args)
	}
	return &Event{name, sender, setArgs, time.Now().UTC(), netID, ni}
}
func (e *Event) Nick() string {
	return Nick(e.Sender)
}
func (e *Event) Username() string {
	return Username(e.Sender)
}
func (e *Event) Hostname() string {
	return Hostname(e.Sender)
}
func (e *Event) SplitHost() (nick, user, hostname string) {
	return Split(e.Sender)
}
func (e *Event) SplitArgs(index int) []string {
	return strings.Split(e.Args[index], ",")
}
func (e *Event) Target() string {
	return e.Args[0]
}
func (e *Event) IsTargetChan() bool {
	return e.NetworkInfo.IsChannel(e.Args[0])
}
func (e *Event) Message() string {
	return e.Args[1]
}