From 7215a29d9071b4209483a59ba53ba5ea66e961b9 Mon Sep 17 00:00:00 2001 From: Anson Date: Tue, 12 Feb 2019 23:40:56 -0700 Subject: [PATCH] Bot was typing for every message even when it shouldn't. This should fix --- bot/stockBot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/stockBot.py b/bot/stockBot.py index 6f48c61..311e24e 100644 --- a/bot/stockBot.py +++ b/bot/stockBot.py @@ -113,9 +113,10 @@ def stockInfo(bot, update): try: # regex to find tickers in messages, looks for up to 4 word characters following a dollar sign and captures the 4 word characters tickers = re.findall("[$](\w{1,4})", message) - bot.send_chat_action(chat_id=chat_id, action=telegram.ChatAction.TYPING) tickerData = tickerInfo.tickerQuote(tickers) + bot.send_chat_action(chat_id=chat_id, action=telegram.ChatAction.TYPING) + for ticker in tickers: ticker = ticker.upper() # Makes sure ticker exists