From 9e04df77eabda337376489dc71d6ccb5a837ace3 Mon Sep 17 00:00:00 2001 From: Nefrace Date: Wed, 7 Apr 2021 23:52:23 +0300 Subject: [PATCH] Trying to remove backslash on doc link --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 8ce2a1e..1378c8c 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,9 @@ console.log(Date.now().toLocaleString()) +console.log(`========================================== + +STARTING BOT + +=============================================`) const TelegramBot = require('node-telegram-bot-api'); const mongoose = require('mongoose'); @@ -276,11 +281,11 @@ bot.onText(/(оффтоп|offtop)/i, async msg => { bot.onText(/док(ументац[а-я]+|[а-я])? ((п)?о )?(?@?[\w\d]{4,32})/i, async(msg, match) => { const chat = await getChat(msg.chat) - console.log(match.length, match, match[match.length-1]) const topic = match[match.length-1] if(!chat) { return } + console.log(topic) const messages = await Trigger.find({trigger: "docs", show: true}) const message = messages[getRandomInt(0, messages.length)].text bot.sendMessage(msg.chat.id, message, {reply_markup: {