-
-
Save parzibyte/1d6e776f39e139125f1c9af230c14204 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bot.onText(new RegExp(`/listar`), async (mensaje) => { | |
const chatId = mensaje.chat.id; | |
const mascotas = await controlador.obtener(); | |
let cadena = ""; | |
mascotas.forEach(mascota => { | |
cadena += `*ID:* ${mascota.id} *Nombre*: ${mascota.nombre} *Creada por:* ${mascota.creada_por} *Timestamp: * ${mascota.timestamp_mensaje} | |
`; | |
}); | |
bot.sendMessage(chatId, cadena, { parse_mode: "markdown" }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment