Skip to content

Instantly share code, notes, and snippets.

@alekssamos
Last active May 23, 2020 10:48
Show Gist options
  • Select an option

  • Save alekssamos/3a2bd5380d580a6976f8c40431391939 to your computer and use it in GitHub Desktop.

Select an option

Save alekssamos/3a2bd5380d580a6976f8c40431391939 to your computer and use it in GitHub Desktop.
Удаление всех диалогов кроме бесед и сообществ. Вставить в https://vk.com/dev/execute и выполнить несколько раз.
var messages = API.messages.getConversations({"count":200});
var i=-1;
var d=0;
var ids=[];
var peer_id=0;
while(i<200) {
i=i+1;
peer_id = messages.items[i].conversation.peer.id;
if(peer_id > 0 && peer_id < 2000000000) {
if(d<=23) {
if(API.messages.deleteConversation({"peer_id":peer_id})) {
ids.push(peer_id);
d=d+1;
}
}
}
}
return {"deleted":d, "ids":ids};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment