X
X
xped7772021-04-25 12:11:09
In contact with
xped777, 2021-04-25 12:11:09

The open_url keyboard does not appear, what should I do?

console.log('')

console.log('-------------------------------')
console.log('  vk-bot запущен.')
console.log('  Написан: XPED')
console.log('  https://vk.com/XPED777')
console.log('-------------------------------')
console.log('')
const { VK } = require('vk-io');
const { HearManager } = require('@vk-io/hear')
const vk = new VK({
  token: "679ab26112c0088d90c3fb2844994799f56410673f3468498e8c9ebe32097c9ec384c84db3a78e0d5a960"
})
let config = require('./database/config.json');
const VKCOINAPI = require('node-vkcoinapi');
const vkc = new VKCOINAPI({
  key: "",
  userId: ,
  token: ""
});
const commands = [];
let developer = 578563299;
let accounts = require('./database/accounts.json');
setInterval(async () => { await saveAll(); }, 500);
const utils = {
    pick: (array) => { return array[utils.random(array.length - 1)]; },
  random: (x, y) => { return y ? Math.round(Math.random() * (y - x)) + x : Math.round(Math.random() * x); }
}
const keyboard = (object) => {
  return {
    	keyboard:JSON.stringify({
    	    one_time: false,
    	    buttons: object
    	})
    }
}
async function saveAccounts() { require('fs').writeFileSync('./database/accounts.json', JSON.stringify(accounts, null, '\t')); return true; }
async function saveAll() { require('fs').writeFileSync('./database/accounts.json', JSON.stringify(accounts, null, '\t')); return true; }
vk.updates.on('message', async (message) => {
  if(Number(message.senderId) <= 0) return;
  if(/\[club202252536\|(.*)\]/i.test(message.text)) message.text = message.text.replace(/\[club202252536\|(.*)\]/ig, '').trim();
  if(message.isChat) return;
  let res = await vkc.api.getMyBalance();
  console.log(Number(res))
  if(!accounts.find(x=> x.id === message.senderId))
  {
    const [user_info] = await vk.api.users.get({ user_id: message.senderId });
    const date = new Date();
    accounts.push({
      id: message.senderId,
      uid: accounts.length,
      name: user_info.first_name,
      mention: true,
      click: 0,
      v: 0,
      uluch_click: 0.0001,
    });
    saveAccounts();
    
    return message.send(`Вы зарегестрированны!`,
{
   "one_time":false,
   "buttons":[
       [
          {
            "action":{
                "type":"text",
                "payload":"{\"button\": \"1\"}",
                "label":" Kлик "
            },
            "color":"positive"
         }
      ],
      [
          {
              "action":{
                  "type":"text",
                  "payload":"{\"button\": \"2\"}",
                  "label":" Cтатистика"
                },
                "color":"negative"
         } 
      ],
      [
          {
              "action":{
                  "type":"text",
                  "payload":"{\"button\": \"2\"}",
                  "label":"Инфо"
                },
                "color":"negative"
         }
      ],
      [
          {
              "action":{
                  "type":"open_link",
                  "link":"qiwi.com/n/KIFIR777",
                  "payload":"{\"button\": \"3\"}",
                  "label":"Задонить"
                },
                "color":"primary"
            }
        ]
    ]
});
  }
  const bot = (text, params) => {
    return message.send(`${text}`, params);
  }
  message.user = accounts.find(x=> x.id === message.senderId);
  const command = commands.find(x=> x[0].test(message.text));
  if(!command)
  {
    if(!message.isChat) return bot(`Такой команды несуществует веди "Меню" чтобы врнуться в меню`);
    if(message.isChat) return;
  }
  message.args = message.text.match(command[0]);
  await command[1](message, bot);
  const [user_info] = await vk.api.users.get({ user_id: message.senderId });
  return;
});
const cmd = {
  hear: (p, f) => {
    commands.push([p, f]);
  }
}
cmd.hear(/^(?: Kлик )$/i, async(message, bot) =>{
  message.user.click++;
  accounts.find(x=> x.uid === 0).v+=message.user.uluch_click;
  const result = vkc.api.sendPayment(message.senderId, message.user.uluch_click*1000, false);
  return bot(` Вам успешно отправлено: ${message.user.uluch_click} VKC`);
});

  
cmd.hear(/^(?: Cтатистика)$/i, async(message, bot) =>{
  return bot(`
 ${message.user.name} ваша статистика и общая статистика:

 Общая:

 Задонатено Всего - 0₽
 Выведено: ${accounts.find(x=> x.uid === 0).v} VKC

 Личная:

 Кликнул: ${message.user.click}
 Вывел: ${message.user.v} VKC`);
});

cmd.hear(/^(?:⚡ Инфо ⚡)$/i, async(message, bot) =>{
  return bot(`
Эта бот кликер по вк коинам
За каждый донат мы прибавлям коинов 2₽= +0.01
За клик сейчас коинов за клик - ${message.user.uluch_click}
Каждые 17часов  если были донаты то обноление вкк за клик!`);
});

cmd.hear(/^(?:Меню)$/i, async(message, bot) =>{
  return bot(`Вы попали в меню!`);
});

vk.updates.start().catch(console.error)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gossteer, 2021-05-14
@Gossteer

open_link does not support color
API for chatbots part 3
609e4b271f6c5544990831.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question