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

Bot now keeps track of symbols for own trending

This commit is contained in:
2021-08-26 19:12:38 +00:00
parent f34fd37597
commit 082c42c39f
2 changed files with 23 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ class Symbol:
symbol: What the user calls it. ie tsla or btc
id: What the api expects. ie tsla or bitcoin
name: Human readable. ie Tesla or Bitcoin
tag: Uppercase tag to call the symbol. ie $TSLA or $$BTC
"""
currency = "usd"
@@ -17,6 +18,7 @@ class Symbol:
self.symbol = symbol
self.id = symbol
self.name = symbol
self.tag = "$" + symbol
def __repr__(self) -> str:
return f"<{self.__class__.__name__} instance of {self.id} at {id(self)}>"
@@ -32,6 +34,7 @@ class Stock(Symbol):
self.symbol = symbol
self.id = symbol
self.name = "$" + symbol.upper()
self.tag = "$" + symbol.upper()
# Used by Coin to change symbols for ids
@@ -44,6 +47,7 @@ class Coin(Symbol):
@functools.cache
def __init__(self, symbol: str) -> None:
self.symbol = symbol
self.tag = "$$" + symbol.upper()
self.get_data()
def get_data(self) -> None: