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
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"

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() {
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,