fix minor issue where bot tries to set its nick every 15 minutes,
even if it has the wanted nick.
This commit is contained in:
parent
78a4c71736
commit
0a5d471404
1
irc.go
1
irc.go
@ -91,6 +91,7 @@ func pinger(i *IRCConnection) {
|
|||||||
i.SendRaw(fmt.Sprintf("PING %d", time.Nanoseconds()))
|
i.SendRaw(fmt.Sprintf("PING %d", time.Nanoseconds()))
|
||||||
//Try to recapture nickname if it's not as configured.
|
//Try to recapture nickname if it's not as configured.
|
||||||
if i.nick != i.nickcurrent {
|
if i.nick != i.nickcurrent {
|
||||||
|
i.nickcurrent = i.nick
|
||||||
i.SendRaw(fmt.Sprintf("NICK %s", i.nick))
|
i.SendRaw(fmt.Sprintf("NICK %s", i.nick))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,4 +110,8 @@ func (irc *IRCConnection) setupCallbacks() {
|
|||||||
irc.nickcurrent = e.Arguments[0]
|
irc.nickcurrent = e.Arguments[0]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
irc.AddCallback("001", func(e *IRCEvent) {
|
||||||
|
irc.nickcurrent = e.Arguments[0]
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user