Answer the question
In order to leave comments, you need to log in
How to send photo to any message after executing VK-IO command?
The bottom line is this: the user sends a command, the bot sends the first photo. If someone sends a message after that, the bot will send a second picture. It seems nothing complicated, but only listening to the event remains and the bot will always send a second picture to any message.
hearManager.hear(/^(?:\.trap)/i, async (context) => {
context.sendPhotos({
value: "./images/chatPhotos/trapOpened.jpg",
});
hearManager.hear(/^(?:)/i, async (context) => {
// Можно юзать vk.updates, но это сути не меняет.
context.sendPhotos({
value: "./images/chatPhotos/trapClosed.jpg",
});
});
});
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