Print ERROR messages

This commit is contained in:
Ken-Håvard Lieng 2017-07-03 07:25:38 +02:00
parent ae6ad0a5b9
commit 9dffb541b9
2 changed files with 11 additions and 5 deletions

View File

@ -1,15 +1,16 @@
package irc package irc
const ( const (
Ping = "PING" Error = "ERROR"
Nick = "NICK"
Join = "JOIN" Join = "JOIN"
Part = "PART"
Mode = "MODE" Mode = "MODE"
Privmsg = "PRIVMSG" Nick = "NICK"
Notice = "NOTICE" Notice = "NOTICE"
Topic = "TOPIC" Part = "PART"
Ping = "PING"
Privmsg = "PRIVMSG"
Quit = "QUIT" Quit = "QUIT"
Topic = "TOPIC"
ReplyWelcome = "001" ReplyWelcome = "001"
ReplyYourHost = "002" ReplyYourHost = "002"

View File

@ -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() { func (i *ircHandler) initHandlers() {
i.handlers = map[string]func(*irc.Message){ i.handlers = map[string]func(*irc.Message){
irc.Nick: i.nick, irc.Nick: i.nick,
@ -297,6 +301,7 @@ func (i *ircHandler) initHandlers() {
irc.Notice: i.message, irc.Notice: i.message,
irc.Quit: i.quit, irc.Quit: i.quit,
irc.Topic: i.topic, irc.Topic: i.topic,
irc.Error: i.error,
irc.ReplyWelcome: i.info, irc.ReplyWelcome: i.info,
irc.ReplyYourHost: i.info, irc.ReplyYourHost: i.info,
irc.ReplyCreated: i.info, irc.ReplyCreated: i.info,