Purchasing rich embeds is now avaliable

This commit is contained in:
Jeremy Zhang
2019-11-06 14:17:29 -08:00
parent aa49b2d473
commit b8b602713a
3 changed files with 33 additions and 0 deletions

View File

@ -63,4 +63,21 @@
}
});
});
$("#buy-send-rich-embed-btn").click(function () {
var formPatch = patchForm("send_rich_embed", 1);
formPatch.done(function (data) {
alert("Successfully bought send rich embed 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 send rich embed perk failed!', 10000);
}
});
});
})();