Implement server webhook icons as cosmetics & fixes

This commit is contained in:
Jeremy Zhang
2017-09-13 05:55:51 +00:00
parent d9edf7e8ef
commit c23b71d050
14 changed files with 186 additions and 18 deletions

View File

@ -46,4 +46,21 @@
}
});
});
$("#buy-webhook-guest-user-avatar-btn").click(function () {
var formPatch = patchForm("webhook_icon", 1);
formPatch.done(function (data) {
alert("Successfully bought webhook guest user avatar perk!");
location.reload();
});
formPatch.fail(function (data) {
if (data.status == 400) {
Materialize.toast('Item already purchased!', 10000);
} else if (data.status == 402) {
Materialize.toast('Insufficient token funds!', 10000);
} else {
Materialize.toast('Purchasing webhook guest user avatar perk failed!', 10000);
}
});
});
})();