///////////////////////////
const GROUP_ID = 178157883;
const mentionPattern = new RegExp(
String.raw`^(?:\[-${GROUP_ID}\|[^\]]+\])(?:[\s.,\'\"!?\-+]+|$)`,
'i'
);
vk.updates.on('message', (context, next) => {
if (context.isChat && !mentionPattern.test(context.text)) {
return;
}
if (context.text) {
context.text = context.text.replace(mentionPattern, '');
}
return next();
});
//////////////////////////