Merge pull request #19 from worr/ctcp_action

Added support for CTCP ACTION (/me)
This commit is contained in:
Thomas Jager 2014-02-02 03:21:25 -08:00
commit a1d207d5fa
2 changed files with 6 additions and 0 deletions

View File

@ -30,6 +30,7 @@ Events for callbacks
* CTCP_CLIENTINFO * CTCP_CLIENTINFO
* CTCP_TIME * CTCP_TIME
* CTCP_PING * CTCP_PING
* CTCP_ACTION (/me)
* PRIVMSG * PRIVMSG
* MODE * MODE
* JOIN * JOIN

View File

@ -54,6 +54,11 @@ func (irc *Connection) RunCallbacks(event *Event) {
} else if event.Message == "CLIENTINFO" { } else if event.Message == "CLIENTINFO" {
event.Code = "CTCP_CLIENTINFO" event.Code = "CTCP_CLIENTINFO"
} else if event.Message[0:6] == "ACTION" {
event.Code = "CTCP_ACTION"
event.Message = event.Message[7:]
} }
} }