IRC: Don't set nick on each tick (#12139)

* Trying harder to regain nick

* Code cleanup

* remove extra nickchange
This commit is contained in:
Olen
2020-09-22 19:29:54 +02:00
committed by GitHub
parent 2b07beca35
commit 0f272e342e

View File

@@ -153,6 +153,7 @@ class IRCBot
}
$this->doAuth();
$this->nickwait = 0;
while (true) {
foreach ($this->socket as $n => $socket) {
if (! is_resource($socket) || feof($socket)) {
@@ -162,7 +163,11 @@ class IRCBot
}
if (isset($this->tempnick)) {
$this->ircRaw('NICK ' . $this->nick);
if ($this->nickwait > 100) {
$this->ircRaw('NICK ' . $this->nick);
$this->nickwait = 0;
}
$this->nickwait += 1;
}
$this->getData();