bridge_with_irc: Implement nickserv password.
This commit is contained in:
parent
5b704b7c1c
commit
5b7f0c24bb
2 changed files with 12 additions and 4 deletions
|
@ -9,14 +9,16 @@ from typing import Any, Dict
|
|||
class IRCBot(irc.bot.SingleServerIRCBot):
|
||||
reactor_class = AioReactor
|
||||
|
||||
def __init__(self, zulip_client, stream, topic, channel, nickname, server, port=6667):
|
||||
# type: (Any, str, str, irc.bot.Channel, str, str, int) -> None
|
||||
def __init__(self, zulip_client, stream, topic, channel,
|
||||
nickname, server, nickserv_password='', port=6667):
|
||||
# type: (Any, str, str, irc.bot.Channel, str, str, str, int) -> None
|
||||
irc.bot.SingleServerIRCBot.__init__(self, [(server, port)], nickname, nickname)
|
||||
self.channel = channel # type: irc.bot.Channel
|
||||
self.zulip_client = zulip_client
|
||||
self.stream = stream
|
||||
self.topic = topic
|
||||
self.IRC_DOMAIN = server
|
||||
self.nickserv_password = nickserv_password
|
||||
|
||||
def zulip_sender(self, sender_string):
|
||||
# type: (str) -> str
|
||||
|
@ -38,6 +40,9 @@ class IRCBot(irc.bot.SingleServerIRCBot):
|
|||
|
||||
def on_welcome(self, c, e):
|
||||
# type: (ServerConnection, Event) -> None
|
||||
if len(self.nickserv_password) > 0:
|
||||
msg = 'identify %s' % (self.nickserv_password,)
|
||||
c.privmsg('NickServ', msg)
|
||||
c.join(self.channel)
|
||||
|
||||
def forward_to_irc(msg):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue