mirror of
https://gitlab.com/simple-stock-bots/simple-stock-bot.git
synced 2025-07-25 23:51:41 +00:00
Bot now provides market news when no ticker is called with /news
This commit is contained in:
@@ -45,8 +45,14 @@ def news(bot, update):
|
||||
|
||||
## Checks if a ticker was passed in
|
||||
if tickers == []:
|
||||
message = "No Ticker, showing Market News:"
|
||||
news = tickerInfo.stockNews("market")
|
||||
for i in range(3):
|
||||
message = "{}\n\n[{}]({})".format(
|
||||
message, news["title"][i], news["link"][i]
|
||||
)
|
||||
update.message.reply_text(
|
||||
"Please type a ticker after your command with a dollar sign: /news $tsla"
|
||||
text=message, parse_mode=telegram.ParseMode.MARKDOWN
|
||||
)
|
||||
else:
|
||||
tickerData = tickerInfo.tickerQuote(tickers)
|
||||
|
Reference in New Issue
Block a user