Renamed function 'get_stations_by_search_query'
renamed to 'get_station_id_list'
This commit is contained in:
parent
69e5285b88
commit
80c2fb4b9d
1 changed files with 2 additions and 2 deletions
4
bot.py
4
bot.py
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue