diff --git a/irc/const.go b/irc/const.go index f521f44a..660bc938 100644 --- a/irc/const.go +++ b/irc/const.go @@ -1,15 +1,16 @@ package irc const ( - Ping = "PING" - Nick = "NICK" + Error = "ERROR" Join = "JOIN" - Part = "PART" Mode = "MODE" - Privmsg = "PRIVMSG" + Nick = "NICK" Notice = "NOTICE" - Topic = "TOPIC" + Part = "PART" + Ping = "PING" + Privmsg = "PRIVMSG" Quit = "QUIT" + Topic = "TOPIC" ReplyWelcome = "001" ReplyYourHost = "002" diff --git a/server/irc_handler.go b/server/irc_handler.go index a0bc61db..3e7ac711 100644 --- a/server/irc_handler.go +++ b/server/irc_handler.go @@ -287,6 +287,10 @@ func (i *ircHandler) badNick(msg *irc.Message) { }) } +func (i *ircHandler) error(msg *irc.Message) { + i.session.printError(msg.LastParam()) +} + func (i *ircHandler) initHandlers() { i.handlers = map[string]func(*irc.Message){ irc.Nick: i.nick, @@ -297,6 +301,7 @@ func (i *ircHandler) initHandlers() { irc.Notice: i.message, irc.Quit: i.quit, irc.Topic: i.topic, + irc.Error: i.error, irc.ReplyWelcome: i.info, irc.ReplyYourHost: i.info, irc.ReplyCreated: i.info,