From 68054eacd5a023f3f9c97162e5f8c4438ab3f12a Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 13 Apr 2020 19:10:02 +0100 Subject: [PATCH] support PASS from ConnectionParams --- ircrobots/params.py | 1 + ircrobots/server.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ircrobots/params.py b/ircrobots/params.py index ef22693..b8ddbd7 100644 --- a/ircrobots/params.py +++ b/ircrobots/params.py @@ -31,5 +31,6 @@ class ConnectionParams(object): realname: Optional[str] = None bindhost: Optional[str] = None + password: Optional[str] = None tls_verify: bool = True sasl: Optional[SASLParams] = None diff --git a/ircrobots/server.py b/ircrobots/server.py index 566f6e8..1899bf4 100644 --- a/ircrobots/server.py +++ b/ircrobots/server.py @@ -97,6 +97,8 @@ class Server(IServer): realname = self.params.realname or nickname # these must remain non-awaited; reading hasn't started yet + if not self.params.password is None: + self.send(build("PASS", [self.params.password])) self.send(build("CAP", ["LS", "302"])) self.send(build("NICK", [nickname])) self.send(build("USER", [username, "0", "*", realname]))