Implement a single function for all callbacks from IRC hooks and send a seperate notification if an action takes place that concerns a bot
This commit is contained in:
@@ -6,9 +6,7 @@ from datetime import datetime
|
||||
import main
|
||||
from utils.logging.log import *
|
||||
|
||||
validTypes = ["msg", "notice", "action", "who", "part", "join", "kick", "quit", "nick", "topic", "mode", "conn", "znc", "query", "self", "highlight", "monitor", "err"]
|
||||
|
||||
selfTypes = ["query", "self", "highlight"]
|
||||
validTypes = ["msg", "notice", "action", "who", "part", "join", "kick", "quit", "nick", "topic", "mode", "conn", "znc", "query", "self", "highlight", "monitor", "err", "query", "self", "highlight"]
|
||||
|
||||
class Relay(Protocol):
|
||||
def __init__(self, addr):
|
||||
@@ -137,7 +135,7 @@ class RelayFactory(Factory):
|
||||
def sendRelayNotification(name, cast):
|
||||
for i in main.relayConnections.keys():
|
||||
if main.relayConnections[i].authed:
|
||||
if cast["type"] in main.relayConnections[i].subscriptions or set(main.relayConnections[i].subscriptions).issubset(cast):
|
||||
if cast["type"] in main.relayConnections[i].subscriptions:
|
||||
newCast = deepcopy(cast)
|
||||
newCast["name"] = name
|
||||
newCast["time"] = str(datetime.now())
|
||||
|
||||
Reference in New Issue
Block a user