deletedbot/frontend/res/create.js
2024-10-28 17:57:26 +01:00

35 lines
672 B
JavaScript

function setBot() {
formData = new FormData
formData.append("token", $("#token").val())
formData.append("text", $("#text").val())
if($("#tec").is(':checked')) {
formData.append("tec", "yes")
}
call = $.ajax( {
url: '/api/setbot',
type: 'POST',
async: false,
data: formData,
processData: false,
contentType: false
});
response = call.responseJSON
UIkit.modal($("#output")).show();
UIkit.toggle($("#output-more")).toggle();
if (response["ok"]){
$("#output-title").html("Success!")
}else{
$("#output-title").html("Error")
}
$("#output-text").html(response['message'])
$("#output-more").html(response['details'])
}