Make destination filter really case insensitive

Closes #1
This commit is contained in:
JuliusFreudenberger 2019-11-06 11:19:55 +01:00
parent 9f19440f9b
commit 3510c87e4d

3
bot.py
View file

@ -121,8 +121,7 @@ def get_vvs_departures(query):
reply.append("Next departures for station: " + request.json()[0]['stopName']) 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.casefold()) != -1 :
query.destination) != -1:
if query.line == '' or (query.line != -1 and station['number'] == query.line): if query.line == '' or (query.line != -1 and station['number'] == query.line):
reply.append( reply.append(
"Line " + station['number'] + " to \"" + station['direction'] + "\" at " "Line " + station['number'] + " to \"" + station['direction'] + "\" at "