def send_image(chat_id): coins = my_binance.get_coins() prices = my_binance.get_prices() balance = my_binance.get_balance() if coins: image = my_image.generate_report(coins, prices, balance) image = my_image.get_image() image, err = Imgur.upload_image(image=image) if err: telegram.send_message( message="There was a problem with the image, please try again", chat_id=chat_id) else: telegram.send_message(chat_id=chat_id, image=image) else: telegram.send_message( message= "Use first /text command to collect the data and generate the image", chat_id=chat_id)