Answer the question
In order to leave comments, you need to log in
How to register conversations in a VK bot?
How to make it so that after adding a bot to a conversation, the bot appears in the database with its ID. Here are my attempts:
updates.startPolling();
updates.on('message', async (message) => {
if(Number(messages.getChat) <= 0) return;
if(/\[public176715957\|(.*)\]/i.test(message. text)) message.text = message.text.replace(/\[public176715957\|(.*)\]/ig, '').trim();
if(!chat.find(x=> x.id = == messages.getChat))
{
const [chat_info] = await messages.getChat({ peerId: message.peerId });
users.push({
peerId: message.peerId,
uid: chats.length
});
console.log( ` +1 player [Players: ${chats.length}]`);
console.log(``);
saveChats();
}
let chats = require('./database/chats.json');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question