Added the ability to make the bot only run for specific users
This commit is contained in:
parent
0d8828bc40
commit
fd61bbf448
2 changed files with 17 additions and 0 deletions
|
@ -31,6 +31,13 @@ class util {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let users = command.users;
|
||||||
|
|
||||||
|
if (!users.includes(message.member.id)) {
|
||||||
|
message.reply(`You do not have permission to run this command`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
command[command.run]({
|
command[command.run]({
|
||||||
"command": name,
|
"command": name,
|
||||||
"arguments": args,
|
"arguments": args,
|
||||||
|
|
|
@ -4,6 +4,7 @@ class command {
|
||||||
|
|
||||||
this._roles = [];
|
this._roles = [];
|
||||||
this._requiredConfigs = [];
|
this._requiredConfigs = [];
|
||||||
|
this._users = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
|
@ -50,6 +51,15 @@ class command {
|
||||||
set requiredConfigs(conf) {
|
set requiredConfigs(conf) {
|
||||||
this._requiredConfigs.push(conf);
|
this._requiredConfigs.push(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Users
|
||||||
|
get users() {
|
||||||
|
return this._users;
|
||||||
|
}
|
||||||
|
|
||||||
|
set users(userid) {
|
||||||
|
this._users.push(userid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = command;
|
module.exports = command;
|
||||||
|
|
Reference in a new issue