1
0
mirror of https://gitlab.com/simple-stock-bots/simple-telegram-stock-bot.git synced 2025-09-19 03:52:46 +00:00

#87: bandaid fix so bot can work without market data, and warns users about the lack of stock market data

This commit is contained in:
2022-08-28 12:57:36 -06:00
parent 06e1f62fff
commit 5df8ff11c2
4 changed files with 170 additions and 15 deletions

View File

@@ -12,7 +12,7 @@ import schedule
from cachetools import TTLCache, cached
from cg_Crypto import cg_Crypto
from IEX_Symbol import IEX_Symbol
from placeholder_Symbol import placeholder_Symbol
from Symbol import Coin, Stock, Symbol
@@ -22,7 +22,7 @@ class Router:
trending_count = {}
def __init__(self):
self.stock = IEX_Symbol()
self.stock = placeholder_Symbol()
self.crypto = cg_Crypto()
schedule.every().hour.do(self.trending_decay)
@@ -62,16 +62,8 @@ class Router:
schedule.run_pending()
symbols = []
stocks = set(re.findall(self.STOCK_REGEX, text))
for stock in stocks:
sym = self.stock.symbol_list[
self.stock.symbol_list["symbol"].str.fullmatch(stock, case=False)
]
if ~sym.empty:
print(sym)
symbols.append(Stock(sym))
else:
info(f"{stock} is not in list of stocks")
if re.findall(self.STOCK_REGEX, text):
symbols.append(Stock())
coins = set(re.findall(self.CRYPTO_REGEX, text))
for coin in coins: