Response sender is not needed anymore, private channels are now better handled

This commit is contained in:
nemunaire 2014-09-18 07:57:06 +02:00
commit 772d68a34d
32 changed files with 161 additions and 182 deletions

View file

@ -32,7 +32,7 @@ def cmd_man(msg):
args.append(msg.cmds[1])
os.unsetenv("LANG")
res = Response(msg.sender, channel=msg.channel)
res = Response(channel=msg.channel)
with subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc:
for line in proc.stdout.read().split(b"\n"):
(line, n) = RGXP_s.subn(b'', line)
@ -50,7 +50,7 @@ def cmd_man(msg):
def cmd_whatis(msg):
args = ["whatis", " ".join(msg.cmds[1:])]
res = Response(msg.sender, channel=msg.channel)
res = Response(channel=msg.channel)
with subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc:
for line in proc.stdout.read().split(b"\n"):
(line, n) = RGXP_s.subn(b'', line)