Implement autorole for embed users

This commit is contained in:
Jeremy Zhang
2018-07-22 06:46:03 +00:00
parent 856dd08167
commit 150e112387
9 changed files with 121 additions and 9 deletions

View File

@ -1,4 +1,5 @@
$('.chips').material_chip();
$('select').material_select();
$('#unauth_users').change(function() {
var pathname = window.location.pathname;
@ -154,6 +155,24 @@ function add_delete_banned_words(action, word) {
});
}
$("#autorole_unauth").change(function () {
var pathname = window.location.pathname;
var value = $(this).val();
var payload = {"autorole_unauth": value}
$.post(pathname, payload, function(data) {
Materialize.toast('Updated Guest AutoRole setting!', 2000)
});
});
$("#autorole_discord").change(function () {
var pathname = window.location.pathname;
var value = $(this).val();
var payload = {"autorole_discord": value}
$.post(pathname, payload, function(data) {
Materialize.toast('Updated Discord AutoRole setting!', 2000)
});
});
function initiate_ban(guild_id, user_id) {
var reason = prompt("Please enter your reason for ban");
var payload = {