Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 5, 2022 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/1d6e776f39e139125f1c9af230c14204 to your computer and use it in GitHub Desktop.
Save parzibyte/1d6e776f39e139125f1c9af230c14204 to your computer and use it in GitHub Desktop.
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