Don't attempt to identify with no password set

Some servers disconnect the client if PASS fails, so the bot will fail
to connect unless SERVER_PASS is also explicitly set to None.
This commit is contained in:
nyuszika7h 2017-01-16 12:37:33 +01:00
parent cef59bce73
commit bde640c9ae
2 changed files with 3 additions and 2 deletions

View File

@ -181,7 +181,8 @@ class IRCClient:
self.send("CAP LS 302")
if self.server_pass and (not self.sasl_auth or "{password}" not in self.server_pass):
if (self.server_pass and "{password}" in self.server_pass
and self.password and not self.sasl_auth):
message = "PASS :{0}".format(self.server_pass).format(
account=self.authname if self.authname else self.nickname,
password=self.password)

View File

@ -75,7 +75,7 @@ def connect_callback(cli):
wolfgame.connect_callback()
# just in case we haven't managed to successfully auth yet
if not botconfig.SASL_AUTHENTICATION:
if botconfig.PASS and not botconfig.SASL_AUTHENTICATION:
cli.ns_identify(botconfig.USERNAME or botconfig.NICK,
botconfig.PASS,
nickserv=var.NICKSERV,