Created
August 21, 2018 09:29
-
-
Save RaghavSood/bf6ada2f4b4eaaabf1969a4bf027d317 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function() { | |
var addid = { | |
command : function ( args, cb ) { | |
var id = Number( args.parse()[0] ); | |
IO.xhr({ | |
url : '/rooms/setuseraccess/15', | |
data : { | |
userAccess : 'read-write', | |
aclUserId : id, | |
fkey : fkey().fkey | |
}, | |
method : 'POST', | |
complete : finish | |
}); | |
function finish ( resp, xhr ) { | |
args.send('Added [' + id + '](http://stackoverflow.com/users/' + id + ')' ); | |
} | |
} | |
}; | |
bot.addCommand({ | |
name : 'addid', | |
fun : addid.command, | |
thisArg : addid, | |
permissions : { | |
del : 'NONE', | |
use : 'OWNER' | |
}, | |
description : 'Adds a user to the write list by ID. Room Owners only. Usage: `/addid userID`' | |
}); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment