M
M
MrZilla2019-03-23 14:18:10
JavaScript
MrZilla, 2019-03-23 14:18:10

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) => {
QdZwQ6cl8xw.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stockholm Syndrome, 2019-03-23
@MrZilla

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 question

Ask a Question

731 491 924 answers to any question