From ddadeb617caa6cf86952faf92bb3e9e54be4f564 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 3 Oct 2019 18:02:00 +0100 Subject: [PATCH] Change message to msg in relay output and in functions, include name in connection notifications instead of net --- core/bot.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/core/bot.py b/core/bot.py index 122b9b0..5737a85 100644 --- a/core/bot.py +++ b/core/bot.py @@ -141,8 +141,8 @@ class IRCBot(IRCClient): cast["nick"], cast["ident"], cast["host"] = self.parsen(cast["muser"]) #if not cast["type"] in ["nick", "kick", "quit", "part", "join"]: # del cast["muser"] - if set(["nick", "ident", "host", "message"]).issubset(set(cast)): - if "message" in cast.keys(): + if set(["nick", "ident", "host", "msg"]).issubset(set(cast)): + if "msg" in cast.keys(): if cast["ident"] == "znc" and cast["host"] == "znc.in": cast["type"] = "znc" cast["name"] = self.name @@ -175,9 +175,9 @@ class IRCBot(IRCClient): castDup["name"] = self.name if not cast["target"].lower() == self.nickname.lower(): # modes has been set on us directly self.event(**castDup) # don't tell anyone else - if "message" in cast.keys() and not cast["type"] == "query": # Don't highlight queries - if not cast["message"] == None: - if self.nickname.lower() in cast["message"].lower(): + if "msg" in cast.keys() and not cast["type"] == "query": # Don't highlight queries + if not cast["msg"] == None: + if self.nickname.lower() in cast["msg"].lower(): castDup = deepcopy(cast) castDup["mtype"] = cast["type"] castDup["type"] = "highlight" @@ -190,13 +190,13 @@ class IRCBot(IRCClient): monitor.event(self.name, cast) def privmsg(self, user, channel, msg): - self.event(type="msg", muser=user, target=channel, message=msg) + self.event(type="msg", muser=user, target=channel, msg=msg) def noticed(self, user, channel, msg): - self.event(type="notice", muser=user, target=channel, message=msg) + self.event(type="notice", muser=user, target=channel, msg=msg) def action(self, user, channel, msg): - self.event(type="action", muser=user, target=channel, message=msg) + self.event(type="action", muser=user, target=channel, msg=msg) def get(self, var): try: @@ -379,7 +379,8 @@ class IRCBot(IRCClient): def signedOn(self): self.connected = True log("signed on: %s" % self.name) - self.event(type="conn", status="connected") + #self.event(type="conn", status="connected") + sendRelayNotification({"type": "conn", "name": self.name, "status": "signedon"}) def joined(self, channel): if not channel in self.channels: