[nextstop] Updated nextstop with destination option

This commit is contained in:
Max 2015-07-05 16:01:39 +01:00 committed by nemunaire
parent b75c54419f
commit 6e226f0fb3
2 changed files with 6 additions and 3 deletions

View File

@ -17,11 +17,14 @@ def help_full ():
@hook("cmd_hook", "ratp")
def ask_ratp(msg):
"""Hook entry from !ratp"""
if len(msg.cmds) == 4:
if len(msg.cmds) >= 4:
transport = msg.cmds[1]
line = msg.cmds[2]
station = msg.cmds[3]
times = ratp.getNextStopsAtStation(transport, line, station)
if len(msg.cmds) == 5:
times = ratp.getNextStopsAtStation(transport, line, station, msg.cmds[4])
else:
times = ratp.getNextStopsAtStation(transport, line, station)
if len(times) == 0:
raise IRCException("la station %s n'existe pas sur le %s ligne %s." % (station, transport, line))

@ -1 +1 @@
Subproject commit 060aad3f42afe4185180e0ba952b72dc1cb4cac6
Subproject commit 3d5c9b2d52fbd214f5aaad00e5f3952de919b3e5