mirror of
https://gitlab.com/simple-stock-bots/simple-stock-bot.git
synced 2025-06-16 15:17:28 +00:00
Only look at messages with a $
This commit is contained in:
parent
e8aeba478c
commit
e08573ff7c
7
bot.py
7
bot.py
@ -164,14 +164,17 @@ def symbol_detect(update: Update, context: CallbackContext):
|
|||||||
try:
|
try:
|
||||||
message = update.message.text
|
message = update.message.text
|
||||||
chat_id = update.message.chat_id
|
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:
|
except AttributeError as ex:
|
||||||
info(ex)
|
info(ex)
|
||||||
return
|
return
|
||||||
if symbols:
|
if symbols:
|
||||||
# Let user know bot is working
|
# Let user know bot is working
|
||||||
context.bot.send_chat_action(chat_id=chat_id, action=telegram.ChatAction.TYPING)
|
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}")
|
info(f"Symbols found: {symbols}")
|
||||||
|
|
||||||
for reply in s.price_reply(symbols):
|
for reply in s.price_reply(symbols):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user