T
T
TheBeJIIHiu2021-12-21 12:29:31
JavaScript
TheBeJIIHiu, 2021-12-21 12:29:31

Why does the bot reply to any message?

Here I have the code:

const {VK, MessageContext} = require('vk-io')
const {HearManager} = require ('@vk-io/hear')
const vk = new VK({
  token: "СЕКРЕТ"
})
const hearManager = new HearManager()

vk.updates.on("message_new", hearManager.middleware)

hearManager.hear(/бот/i, async (context) => {
  await context.reply("✅ На месте!")
})

vk.updates.start()
console.log("Started")


The bot should only respond to the "bot" message.

I write to the bot "DyaLla" and he replies "✅ On the spot!",
Why is that?

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