Trying to remove backslash on doc link

This commit is contained in:
Nefrace 2021-04-07 23:52:23 +03:00
parent c953f29d12
commit 9e04df77ea
1 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,9 @@
console.log(Date.now().toLocaleString()) console.log(Date.now().toLocaleString())
console.log(`==========================================
STARTING BOT
=============================================`)
const TelegramBot = require('node-telegram-bot-api'); const TelegramBot = require('node-telegram-bot-api');
const mongoose = require('mongoose'); const mongoose = require('mongoose');
@ -276,11 +281,11 @@ bot.onText(/(оффтоп|offtop)/i, async msg => {
bot.onText(/док(ументац[а-я]+|[а-я])? ((п)?о )?(?<topic>@?[\w\d]{4,32})/i, async(msg, match) => { bot.onText(/док(ументац[а-я]+|[а-я])? ((п)?о )?(?<topic>@?[\w\d]{4,32})/i, async(msg, match) => {
const chat = await getChat(msg.chat) const chat = await getChat(msg.chat)
console.log(match.length, match, match[match.length-1])
const topic = match[match.length-1] const topic = match[match.length-1]
if(!chat) { if(!chat) {
return return
} }
console.log(topic)
const messages = await Trigger.find({trigger: "docs", show: true}) const messages = await Trigger.find({trigger: "docs", show: true})
const message = messages[getRandomInt(0, messages.length)].text const message = messages[getRandomInt(0, messages.length)].text
bot.sendMessage(msg.chat.id, message, {reply_markup: { bot.sendMessage(msg.chat.id, message, {reply_markup: {