resid = count #number of messages with the user
offset = 0
h = []
while resid > 0:
message_users = vk_session.method('messages.getHistory', {'peer_id': user, 'count':200, "rev": 1, 'offset':offset})
h += message_users['items']
resid -= 200
offset += 200
print(resid)
var result = [];
var offset = 0;
var peer_id = 123456;
var count = 100;
var cycles = 20;
while (cycles != 0) {
result.push(API.messages.getHistory({"peer_id": peer_id , "count":count, "rev": 1, "offset":offset}));
offset = offset + count;
cycles = cycles - 1;
};
return result ;