Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 5, 2022 16:22
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/c71c82306e1eaca36ff5bb1d40bf3a97 to your computer and use it in GitHub Desktop.
Save parzibyte/c71c82306e1eaca36ff5bb1d40bf3a97 to your computer and use it in GitHub Desktop.
bot.onText(new RegExp('\/insertar (\\d+|\\w+)'), async (mensaje, coincidencias) => {
const nombre = coincidencias[1];
const chatId = mensaje.chat.id;
const nombreUsuario = mensaje.from.first_name;
const timestampMensaje = mensaje.date;
await controlador.insertar(nombre, nombreUsuario, timestampMensaje);
bot.sendMessage(chatId, nombreUsuario + " quiere insertar mascota llamada " + nombre);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment