Add special case message for no such ship
This commit is contained in:
parent
e21aff9f7f
commit
3fbfc5ce93
|
@ -7,7 +7,11 @@ def on_roster(self,channel,nick,*namecnt):
|
|||
if not namecnt:
|
||||
self.say(channel,"{}: Must supply a filter!".format(nick))
|
||||
return
|
||||
output = subprocess.check_output(["/usr/local/bin/roster",' '.join(namecnt)]).decode("utf-8").split("\n")
|
||||
try:
|
||||
output = subprocess.check_output(["/usr/local/bin/roster",' '.join(namecnt)]).decode("utf-8").split("\n")
|
||||
except subprocess.CalledProcessError:
|
||||
self.say(channel,"{}: No such ship/user!".format(nick))
|
||||
return
|
||||
output = filter(None,output)
|
||||
for line in output:
|
||||
line = re.sub("\s+"," ",line).split(" ",1)
|
||||
|
|
Loading…
Reference in New Issue