Флуд в вк

github.com/negezor/vk-io
http://pastebin.com/8BVc2UxK
Код:
'use strict';

const vk = new (require('vk-io'));

vk.setToken('Сюда_Токен');

vk.stream.messages.getDialogs({
    count: 2000 /* 2000 диалогов получить ибо больше не нужно наверное */
})
.then((dialogs) => {
    const chain = vk.chain();

    dialogs.forEach((dialog) => {
        if (!('unread' in dialog)) {
            return;
        }

        chain.append('messages.markAsAnsweredDialog',{
            peer_id: dialog.message.id
        });
    });

    return chain.execute();
})
.then((dialogs) => {
    console.log('Помечено прочитанными',dialogs.items,'диалогов!');
});
 
Назад
Сверху