¿Por qué escribir 40 líneas de código para descargar fotos de Telegram antes de poder ejecutar inferencia? auto_save_in de wconnect deposita los archivos en tu disco antes de invocar tu función.
Así se implementa Zero-Code Attachment Ingestion en entornos reales con wconnect:
from wconnect import Wtelegram, WMessage
bot = Wtelegram(auto_save_in="./vault_inbox")
@bot.on_message(value_type="image")
def handle_cv_snapshot(msg: WMessage) -> None:
print(f"Processing image at: {msg.saved_path}")
bot.send(to=msg.chat_id, message="Image queued for ML inspection 🔍")
bot.run_consumers(block=True)
@bot.on_command, @bot.on_message, @bot.consumer). WFile. run_consumers(block=False).
¡Visita el repositorio en GitHub!