From e08573ff7c2ce227885c4c06fe41b08fd4c56962 Mon Sep 17 00:00:00 2001 From: Anson Date: Tue, 5 Oct 2021 15:28:51 -0700 Subject: [PATCH] Only look at messages with a `$` --- bot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 0d413c6..88145ba 100644 --- a/bot.py +++ b/bot.py @@ -164,14 +164,17 @@ def symbol_detect(update: Update, context: CallbackContext): try: message = update.message.text chat_id = update.message.chat_id - symbols = s.find_symbols(message) + if "$" in message: + symbols = s.find_symbols(message) + info("Looking for Symbols") + else: + return except AttributeError as ex: info(ex) return if symbols: # Let user know bot is working context.bot.send_chat_action(chat_id=chat_id, action=telegram.ChatAction.TYPING) - info(f"User called for symbols: {update.message.chat.username}") info(f"Symbols found: {symbols}") for reply in s.price_reply(symbols):