Answer the question
In order to leave comments, you need to log in
If I run a function via setTimeout, then it does not work, what should I do?
class dg_commands {
constructor(token,peer_id) {
this.vk = new VK({
token: token, // Token group
});
this.peer_id = peer_id;
this.group_id = -xxxxxxxx
};
async send(text) {
var res = await this.vk.api.messages.send({
peer_id: this.peer_id,
message: text
});
return res
};
async full(){
setTimeout(this.send, 1000,'text'); // not working
this.send('text'); // work
};
};
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