L
L
Ligeia2020-12-12 21:59:13
In contact with
Ligeia, 2020-12-12 21:59:13

How to make the VK bot forward the message?

It is necessary to make the bot forward messages (well, that is, answer the last message) in the dialogue! not in conversation

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey delphinpro, 2016-12-30
@DirecTwiX

frontender.info/es6-in-depth-arrow-functions/#what...

I
Ivanq, 2016-12-30
@Ivanq

In 1 case arrow functions are used. They do not have their own this, inheriting from the parent. For example:

// Пусть this - [object MyObject]
function log() {
    console.log(this);
};

var obj = new MyObject2();
obj.on("ready", () => log()); // [object MyObject];

In case 2, a function that has not yet been called is simply passed. And when it is called, another this is used.
// Пусть this - [object MyObject]
function log() {
    console.log(this);
};

var obj = new MyObject2();
obj.on("ready", log); // [object MyObject2];

W
warcevil, 2016-12-30
@warcevil

Everything is very simple, you just need to read about classes. They have properties and functions. So when we use this, we indicate that we want to access a property or method of an instance of this class. Try to look at your code in more detail. If you go upstairs, you will see that the msg property is declared at the top, or declared in the parent class from which your class inherits.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question