Answer the question
In order to leave comments, you need to log in
How to remove spam when using vk.updates.hear(/(.*)/, async (context) => {?
When using
I receive spam.
How to get rid of it?vk.updates.hear(/(.*)/, async (context) => {
Answer the question
In order to leave comments, you need to log in
check if the sender is a bot, then do nothing
const BOT_ID = 1; // идентификатор бота
vk.updates.hear(/(.*)/, async (message) => {
if (message.senderId === BOT_ID) return;
// ...
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question