Trying to remove backslash on doc link
This commit is contained in:
parent
c953f29d12
commit
9e04df77ea
7
index.js
7
index.js
|
@ -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: {
|
||||||
|
|
Loading…
Reference in New Issue