V
V
Vyacheslav14102020-07-03 10:13:15
JavaScript
Vyacheslav1410, 2020-07-03 10:13:15

How to fix error in console (node ​​js)?

I use "Botact" library and "node js" framework to create a bot.
There is the following code

const express = require('express');

const bodyParser = require('body-parser');

const {Botact} = require('botact');

const server = express();

const bot = new Botact({
  token: 'my_token',
  confirmation: ' my_token'
})

bot.on(function (ctx) {
  ctx.reply(ctx.body);
})

server.use(bodyParser.json());

server.post('/',bot.listen); 

server.listen(80);

When the function is executed, namely the line "ctx.reply(ctx.body);", the error "UnhandledPromiseRejectionWarning: #Object" is output to the console. Previously, I did not meet such an error and I did not find a clear answer to the question in the vastness of the Russian Internet, please help.
5efeda5e7222d616556803.jpeg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question