import { VK } from 'vk-io';
const MY_GROUP_ID = 123456;
const vk = new VK({
// ...
pollingGroupId: MY_GROUP_ID
});
vk.updates.on('chat_invite_user', async (context, next) => {
const { eventMemberId } = context;
if (eventMemberId === -MY_GROUP_ID) {
console.log('It\'s invited my group!');
// ...
return;
}
console.log('Other invited', eventMemberId);
});
vk.updates.startPolling().catch(console.error);