From 25607a733397460fec16b8e211f4189aee1e689b Mon Sep 17 00:00:00 2001 From: juakotorres Date: Sun, 15 Mar 2020 00:54:09 -0300 Subject: [PATCH] halp --- bot.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/bot.js b/bot.js index c492710..e00042f 100644 --- a/bot.js +++ b/bot.js @@ -14,7 +14,7 @@ const memeGenerator = new memeLib({ fontOptions: { // optional fontSize: 46, fontFamily: 'impact', - lineHeight: 2 + lineHeight: 4 } }); @@ -35,10 +35,22 @@ bot.onText(/\/cuandoLaTesis/, (msg, match) => { // 'msg' is the received Message from Telegram // 'match' is the result of executing the regexp above on the text content // of the message +}); +bot.onText(/\/halp/, (msg, match) => { + // 'msg' is the received Message from Telegram + // 'match' is the result of executing the regexp above on the text content + // of the message + + bot.sendMessage(msg.chat.id, + "Cómo usar este bot :) (Para simios)," + + "/CuandoLaTesis commando en desarrollo," + + "/CuandoElBorrador entrega cuanto te queda para escribir el borrador," + + "/CuandoLaRevision entrega cuanto falta para que te entreguen tu revisión de la tesis," + + "/termineLaTesisCTM [fecha] registra el día que das la charla II, la fecha es opcional (YYYY-MM-DD)," + + "/entregueElBorrador [fecha] registra el día que entregaste el borrador, la fecha es opcional (YYYY-MM-DD)." + ).then(() => {}); - console.log(msg.from.id); - console.log(msg.chat.id); }); bot.onText(/\/cuandoLaRevision/, (msg, match) => { @@ -78,7 +90,7 @@ bot.onText(/\/cuandoLaRevision/, (msg, match) => { } else { const diffTime = Math.abs(now - date); - const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); + const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) - 1; const diffHrs = Math.floor((diffTime % 86400000) / 3600000); // hours const diffMinutes = Math.round(((diffTime % 86400000) % 3600000) / 60000); // minutes