mirror of https://github.com/str4d/RelayBot.git
Add read-only relay.
This commit is contained in:
parent
45287ffedd
commit
f56f9998d1
10
relaybot.py
10
relaybot.py
|
@ -47,6 +47,9 @@ def main():
|
|||
elif mode == "NickServ":
|
||||
factory = NickServFactory
|
||||
options["nickServPassword"] = get("nickServPassword")
|
||||
elif mode == "ReadOnly":
|
||||
factory = ReadOnlyFactory
|
||||
options["nickServPassword"] = get("nickServPassword")
|
||||
|
||||
factory = factory(options)
|
||||
reactor.connectTCP(options['host'], int(options['port']), factory, int(options['timeout']))
|
||||
|
@ -239,6 +242,13 @@ class NickServRelayer(SilentJoinPart):
|
|||
self.desiredNick = config['nick']
|
||||
self.nickPoll = LoopingCall(self.regainNickPoll)
|
||||
|
||||
class ReadOnlyRelayer(NickServRelayer):
|
||||
def sayToChannel(self, message):
|
||||
pass
|
||||
|
||||
class ReadOnlyFactory(RelayFactory):
|
||||
protocol = ReadOnlyRelayer
|
||||
|
||||
class NickServFactory(RelayFactory):
|
||||
protocol = NickServRelayer
|
||||
|
||||
|
|
Loading…
Reference in New Issue