vk.updates.on('new_message', (ctx) => {
if (ctx.messagePayload.button == 1) {
// ...
}
});
const attachType = 'photo';
obj.attachType // вернёт obj.attachType
obj[attachType] // вернёт obj.photo
const attachments = content.attachments
.map((o) => `${o.type}${o[o.type].owner_id}_${o[o.type].id}`)
.join(',');