1
0
mirror of https://gitlab.com/simple-stock-bots/simple-stock-bot.git synced 2025-06-16 07:16:40 +00:00

clean up logs

This commit is contained in:
Anson 2021-08-15 20:07:32 -07:00
parent 89e8566427
commit 1bbbaa5f4e
2 changed files with 11 additions and 6 deletions

12
bot.py
View File

@ -161,11 +161,13 @@ def symbol_detect(update: Update, context: CallbackContext):
Runs on any message that doesn't have a command and searches for symbols, Runs on any message that doesn't have a command and searches for symbols,
then returns the prices of any symbols found. then returns the prices of any symbols found.
""" """
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) symbols = s.find_symbols(message)
except AttributeError as ex:
info(ex)
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)

View File

@ -51,7 +51,10 @@ class Router:
symbols.append(Coin(coin.lower())) symbols.append(Coin(coin.lower()))
else: else:
info(f"{coin} is not in list of coins") info(f"{coin} is not in list of coins")
info(symbols)
if symbols:
info(symbols)
return symbols return symbols
def status(self, bot_resp) -> str: def status(self, bot_resp) -> str: