irc.py

changeset 112
cdafc1a0544e
parent 94
2c93636202a5
child 117
6c0609395889
equal deleted inserted replaced
111:44d9aea72947 112:cdafc1a0544e
148 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 148 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
149 # 149 #
150 # Handle a PRIVMSG line from the IRC server 150 # Handle a PRIVMSG line from the IRC server
151 # 151 #
152 def handle_privmsg (self, line): 152 def handle_privmsg (self, line):
153 rex = re.compile (r'^:([^!]+)!([^@]+)@([^ ]+) PRIVMSG ([^ ]+) :(.+)$') 153 rex = re.compile (r'^:([^!]+)!([^@]+)@([^ ]+) PRIVMSG ([^ ]+) :(.*)$')
154 match = rex.match (line) 154 match = rex.match (line)
155 155
156 if not match: 156 if not match:
157 broadcast ("Recieved bad PRIVMSG: %s" % line) 157 broadcast ("Recieved bad PRIVMSG: %s" % line)
158 return
158 159
159 sender = match.group (1) 160 sender = match.group (1)
160 user = match.group (2) 161 user = match.group (2)
161 host = match.group (3) 162 host = match.group (3)
162 channel = match.group (4) 163 channel = match.group (4)

mercurial