diff --git a/irc.go b/irc.go index 410aadd..e8c63f8 100644 --- a/irc.go +++ b/irc.go @@ -91,6 +91,7 @@ func pinger(i *IRCConnection) { i.SendRaw(fmt.Sprintf("PING %d", time.Nanoseconds())) //Try to recapture nickname if it's not as configured. if i.nick != i.nickcurrent { + i.nickcurrent = i.nick i.SendRaw(fmt.Sprintf("NICK %s", i.nick)) } } diff --git a/irc_callback.go b/irc_callback.go index 61592e2..018fec5 100644 --- a/irc_callback.go +++ b/irc_callback.go @@ -110,4 +110,8 @@ func (irc *IRCConnection) setupCallbacks() { irc.nickcurrent = e.Arguments[0] } }) + + irc.AddCallback("001", func(e *IRCEvent) { + irc.nickcurrent = e.Arguments[0] + }) }