Renamed function 'get_stations_by_search_query'

renamed to 'get_station_id_list'
This commit is contained in:
JuliusFreudenberger 2019-10-15 19:17:57 +02:00
parent 69e5285b88
commit 80c2fb4b9d

4
bot.py
View file

@ -53,7 +53,7 @@ def inline_station_search(update, context):
if len(query) < 5 or not query: if len(query) < 5 or not query:
return return
results = list() results = list()
for station in get_stations_by_search_query(query): for station in get_station_id_list(query):
results.append( results.append(
InlineQueryResultArticle( InlineQueryResultArticle(
id=station['stationId'], id=station['stationId'],
@ -64,7 +64,7 @@ def inline_station_search(update, context):
context.bot.answer_inline_query(update.inline_query.id, results) context.bot.answer_inline_query(update.inline_query.id, results)
def get_stations_by_search_query(name): def get_station_id_list(name):
request = requests.get("https://efa-api.asw.io/api/v1/station/?search=" + name) request = requests.get("https://efa-api.asw.io/api/v1/station/?search=" + name)
return request.json() return request.json()