1
0
mirror of https://gitlab.com/simple-stock-bots/simple-telegram-stock-bot.git synced 2025-07-25 07:31:48 +00:00

Merge branch 'canaryCanary' into 'canary'

Fixes inline search functionality

See merge request simple-stock-bots/simple-telegram-stock-bot!21
This commit is contained in:
2021-05-27 05:24:44 +00:00
4 changed files with 47 additions and 21 deletions

5
bot.py
View File

@@ -419,12 +419,11 @@ def inline_query(update: Update, context: CallbackContext):
Does a fuzzy search on input and returns stocks that are close.
"""
matches = s.search_symbols(update.inline_query.query)[:]
matches = s.inline_search(update.inline_query.query)[:5]
symbols = " ".join([match[1].split(":")[0] for match in matches])
prices = s.batch_price_reply(s.find_symbols(symbols))
# print(len(matches), len(prices))
# print(prices)
results = []
print(update.inline_query.query)
for match, price in zip(matches, prices):