B
B
ban_machine_228_eng2021-02-26 23:49:43
In contact with
ban_machine_228_eng, 2021-02-26 23:49:43

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",
        });
    });
});


I would like to close the listen after sending the second picture.

603969e9ed596727549908.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aassww, 2021-03-08
@thewayofmagic

Create a variable that will be responsible for the action that is happening at the moment, and send the desired image under certain conditions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question