From: Eric S. Raymond Date: Sun, 26 Aug 2012 17:59:50 +0000 (-0400) Subject: Change a string to match an IRC command. X-Git-Tag: 1.0~110 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c45ac845155ef49934c586b987b1b469d2da38ec;p=irker.git Change a string to match an IRC command. --- diff --git a/irker.py b/irker.py index 0876412..7bd3d3b 100755 --- a/irker.py +++ b/irker.py @@ -2,7 +2,7 @@ """ irker - a simple IRC multiplexer daemon -Takes JSON objects of the form {'channel':, 'message':} +Takes JSON objects of the form {'channel':, 'privmsg':} and relays messages to IRC channels. Run this as a daemon in order to maintain stateful connections to IRC @@ -111,11 +111,11 @@ class Irker: "Perform a JSON relay request." try: request = json.loads(line.strip()) - if "channel" not in request or "message" not in request: + if "channel" not in request or "privmsg" not in request: self.logerr("ill-formed reqest") else: channel = request['channel'] - message = request['message'] + message = request['privmsg'] if channel not in self.sessions: self.sessions[channel] = Session(self, channel) self.sessions[channel].enqueue(message)