Added station name in first message
the name is parsed from the first departure information
This commit is contained in:
parent
1077d9acc4
commit
c11d324588
1 changed files with 1 additions and 1 deletions
2
bot.py
2
bot.py
|
@ -112,7 +112,7 @@ def get_vvs_departures(query):
|
||||||
request = requests.get("https://efa-api.asw.io/api/v1/station/" + query.station_id + "/departures")
|
request = requests.get("https://efa-api.asw.io/api/v1/station/" + query.station_id + "/departures")
|
||||||
if request.status_code != 200:
|
if request.status_code != 200:
|
||||||
raise ServerCommunicationError
|
raise ServerCommunicationError
|
||||||
reply.append("Next departures:")
|
reply.append("Next departures for station: " + request.json()[0]['stopName'])
|
||||||
printed_departures = 0
|
printed_departures = 0
|
||||||
for station in request.json():
|
for station in request.json():
|
||||||
if station['direction'].casefold().find(query.destination) != -1 or station['direction'].find(
|
if station['direction'].casefold().find(query.destination) != -1 or station['direction'].find(
|
||||||
|
|
Loading…
Reference in a new issue