def echo(update, context): """Echo the user message.""" update.message.reply_text("➰ Working on it... puede tardar unos segundos") bot = telegram.Bot(token=TELEGRAM_TOKEN) symbol = update.message.text.upper() ticker = Symbol(symbol) grafico = ticker.chart() if grafico is False: update.message.reply_text("⚠️ - No es un símbolo válido -") elif grafico == 0: caption = ticker.quote() update.message.reply_text(f"⚠️ - Error con el gráfico, probablemente por cantidad de datos menores a un año -\n{caption}") else: caption = ticker.quote() bot.send_photo(chat_id=update.message.chat_id, photo=open('chart.png', 'rb'), caption= caption) update.message.reply_text("📰 Buscando última noticia...") news = ticker.news() update.message.reply_text(news, parse_mode="HTML")