A
A
Alexander Arkhangelsky2019-11-25 23:37:10
In contact with
Alexander Arkhangelsky, 2019-11-25 23:37:10

Why doesn't the greeting work when a user enters a conversation?

Hello. I'm not very good at writing bots yet, maybe I just missed something. But I just can’t understand what’s wrong here, the bot does not respond to users entering the conversation.
Tell me if something is wrong. Thanks in advance.
_

vk.updates.hear("chat_invite_user", async (message, next) => { 
   if(message.eventMemberId == '-id') { 
    return message.sendSticker(8146); 
} else {
    const user = await vk.api.users.get({user_id: message.eventMemberId}); 
    message.send(`@id${message.eventMemberId} (${user[0].first_name} ${user[0].last_name}) приглашён в беседу.`); 
    return message.sendSticker(11312); 
   } 
  });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Arkhangelsky, 2019-11-26
@Wertaer

Issue resolved.
Need to be replaced with:

vk.updates.on("chat_invite_user", async (message, next)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question