X
X
xped7772021-04-17 23:35:44
In contact with
xped777, 2021-04-17 23:35:44

ReferenceError: message is not defined What to do?

<//storage/emulated/0/bot/TEST/app.js:29
                return message.send(`Вы зарегестрированны!`, keyboard(
                ^

ReferenceError: message is not defined

console.log('')
console.log('-------------------------------')
console.log('  vk-bot запущен.')
console.log('  Написан: ����')
console.log('  https://vk.com/����')
console.log('-------------------------------')
console.log('')
const { VK } = require('vk-io');
const { HearManager } = require('@vk-io/hear')
const vk = new VK({
  token: ""
})

const commands = [];
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
    	})
    }
}

    return message.send(`Вы зарегестрированны!`, keyboard(
    ));
 
const cmd = {
  hear: (p, f) => {
    commands.push([p, f]);
  }
}
cmd.hear(/^(?: Удвоить Деньги )$/i, async(message, bot) =>{
  return bot(` Вам нужно будет перейти и оплатить по ссылке`)
  return bot(`Незабуть указать айди: ${context.senderId} в коментарии`);
});

  
cmd.hear(/^(?: Инфо )$/i, async(message, bot) =>{
  return bot(`Инфо`);
});

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)
P
Pavel Shvedov, 2021-04-18
@mmmaaak

Translate the error message in Google translator, and if it doesn’t become clear anyway, then forget it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question