D
D
defany2021-06-17 13:13:48
In contact with
defany, 2021-06-17 13:13:48

How to make a reaction to joining a conversation via a link?

Made events that would respond to the entry into the conversation. An invitation through friends works and the bot responds, but not through a link.

I searched for the answer on my own, but did not find it.
My code:

vk.updates.on([ 'chat_invite_user', 'chat_invite_user_by_link' ], async (context) => {
    context.send('Привет')
    console.log(context)
  })


Please help as I don't understand how to do this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
defriz, 2021-06-18
@defriz

the trouble with spaces
remove the indents in square brackets, except for the one after the comma
at the end, remove the indents to brackets
spaces after async, leave
it should be something like:
vk.updates.on([ 'chat_invite_user', space'chat_invite_user_by_link' ], async (context) => {
'tab'context.send('Hello')
'tab'console.log(context)
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question