Skip to content

Instantly share code, notes, and snippets.

@RaghavSood
Created August 21, 2018 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RaghavSood/bf6ada2f4b4eaaabf1969a4bf027d317 to your computer and use it in GitHub Desktop.
Save RaghavSood/bf6ada2f4b4eaaabf1969a4bf027d317 to your computer and use it in GitHub Desktop.
( 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