Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const send = MPP.chat.send; //i used it extra
- const prefix = "."; //just exmaple
- //method 1 - only you can use
- MPP.client.on('a', function(msg){ //for take your id and user id (who will use command)
- var you = MPP.client.getOwnParticipant(); //its you
- var userid = msg.p.id; //its userid who will use command
- var yourid = you.id; //its your id
- //and here its done
- //now follow methods
- //exmaple of a command here bellow
- if (msg.a.startsWith(prefix+"command")){
- if (userid != yourid) return send("You don't have any permission to use this command"); // "!=" it means if not not equals and "==" it means if equals
- //now your main command code bellow...............
- }
- })
- //method 2 - adding custom admins
- const admins = ["368bff184db7a3c669da1ca5", "a8c86bb6e74c9ec8900e061a"]; //add your curstom admin id here to make someone admin
- //its the important admin code to get admin id
- var admin = admins.length;
- if (admin > 0){
- var i;
- for(i = 0; i < admins.length; ++i)
- var adminuser = admins[i];
- }
- //now addning command
- MPP.client.on('a', function msg(){
- var userid = msg.p._id;
- if (msg.a.startsWith(prefix+"command")){
- if (userid != adminuser) return send("You dont have any permission to use this command");
- //your command code bellow....................
- }
- })
- //method 3 - adding cudtom id
- MPP.client.on('a', function msg(){
- var userid = msg.p._id;
- if (msg.a.startsWith(prefix+"command")){
- if (userid != "368bff184db7a3c669da1ca5") return send("You don't have any permission to use this command");
- //your command code bellow
- //its "368bff184db7a3c669da1ca5" means its admin
- }
- })
- //and thx for checking it :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement