diff --git a/irc_callback.go b/irc_callback.go index ff688c5..a7576c9 100644 --- a/irc_callback.go +++ b/irc_callback.go @@ -77,7 +77,7 @@ func (irc *Connection) ReplaceCallback(eventcode string, i string, callback func // Execute all callbacks associated with a given event. func (irc *Connection) RunCallbacks(event *Event) { msg := event.Message() - if event.Code == "PRIVMSG" && len(msg) > 0 && msg[0] == '\x01' { + if event.Code == "PRIVMSG" && len(msg) > 2 && msg[0] == '\x01' { event.Code = "CTCP" //Unknown CTCP if i := strings.LastIndex(msg, "\x01"); i > -1 {