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:
return
results = list()
for station in get_stations_by_search_query(query):
for station in get_station_id_list(query):
results.append(
InlineQueryResultArticle(
id=station['stationId'],
@ -64,7 +64,7 @@ def inline_station_search(update, context):
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)
return request.json()