This commit is contained in:
Astra 2018-04-22 00:41:03 -04:00
parent 0c94e41785
commit ec80470907

View file

@ -34,16 +34,21 @@
// fetch the changelog
fetch('https://endpwn.github.io/changelog.md?_=' + Date.now()).then(r => r.text()).then(l => {
// get the changelog object
var log = $api.util.findFuncExports('changeLog');
var data = l.split(';;');
// we're racing discord's initialization procedures; try and hit a timing sweetspot
setTimeout(() => {
// set the date
if (log.changeLog.date <= data[0])
log.changeLog.date = data[0];
// get the changelog object
var log = $api.util.findFuncExports('changeLog');
var data = l.split(';;');
// prepend to the changelog body
log.changeLog.body = data[1] + '\n\n' + log.changeLog.body;
// set the date
if (log.changeLog.date <= data[0])
log.changeLog.date = data[0];
// prepend to the changelog body
log.changeLog.body = data[1] + '\n\n' + log.changeLog.body;
}, 100);
});