Dare you to post this / Now I triple dog dare you / I knew you wouldn't
5
   
Award
Favorite
Favorited
Unfavorite
Download
"clearMessages = (before) => {
var authToken = document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.fingerprint.replace(/"/g, "")
, headers = {"authorization": '' }
, channel = window.location.href.split('/').pop().replace(/\?.*/, '')
, baseURL = `https://discordapp.com/api/channels/${channel}/messages`;
console.log(`${authToken} | ${channel} | ${baseURL}`);
let clock = 0;
let interval = 500;
function delay(duration) {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(), duration);
});
}
try {
fetch(baseURL + '?before=' + before + '&limit=100', {headers})
.then(resp => resp.json())
.then(messages => {
return Promise.all(messages.map((message) => {
before = message.id;
return delay(clock += interval).then(() => fetch(`${baseURL}/${message.id}`, {headers, method: 'DELETE'}));
}));
}).then(() => clearMessages(before));
} catch(e) {
console.log(e);
console.log(before);
clearMessages(before);
}
};
"
1 Comments
rus_wh 4 Oct, 2018 @ 12:28am 
:kctease: