1
0
mirror of https://gitlab.com/simple-stock-bots/simple-telegram-stock-bot.git synced 2025-08-02 11:31:29 +00:00

patch to stop inline queries from failing until stock data is added

This commit is contained in:
2023-09-07 04:50:20 +00:00
parent 160170409e
commit 541be6c783
2 changed files with 15 additions and 6 deletions

View File

@@ -123,7 +123,8 @@ class Router:
Each tuple contains: (Symbol, Issue Name).
"""
df = pd.concat([self.stock.symbol_list, self.crypto.symbol_list])
# df = pd.concat([self.stock.symbol_list, self.crypto.symbol_list])
df = self.crypto.symbol_list
df = df[df["description"].str.contains(search, regex=False, case=False)].sort_values(
by="type_id", key=lambda x: x.str.len()
@@ -353,7 +354,8 @@ class Router:
return "Trending data is not currently available."
def random_pick(self) -> str:
choice = random.choice(list(self.stock.symbol_list["description"]) + list(self.crypto.symbol_list["description"]))
# choice = random.choice(list(self.stock.symbol_list["description"]) + list(self.crypto.symbol_list["description"]))
choice = random.choice(list(self.crypto.symbol_list["description"]))
hold = (datetime.date.today() + datetime.timedelta(random.randint(1, 365))).strftime("%b %d, %Y")
return f"{choice}\nBuy and hold until: {hold}"