change out admin-only for minimum power level
This commit is contained in:
parent
da06f52739
commit
99e0b86d50
2 changed files with 4 additions and 3 deletions
|
@ -46,7 +46,7 @@ export default {
|
|||
command: "toggle",
|
||||
name: "toggle",
|
||||
usage: "<module>",
|
||||
admin: true,
|
||||
minPwr: 50,
|
||||
desc: "toggle a module on or off in current channel",
|
||||
execute
|
||||
}
|
||||
|
|
5
index.js
5
index.js
|
@ -70,8 +70,9 @@ function doCommand(client, event, cmd, args) {
|
|||
if(!command)
|
||||
return false;
|
||||
|
||||
if((command.owner && event.sender.userId != process.env.OWNER_ID) || (command.admin && event.sender.powerLevel < 100 && event.sender.userId != process.env.OWNER_ID)) {
|
||||
var addl = `Are you sure this command is for you?\nYour power level is ${event.sender.powerLevel}`;
|
||||
if((command.owner && event.sender.userId != process.env.OWNER_ID) || (command.minPwr && event.sender.powerLevel < command.minPwr && event.sender.userId != process.env.OWNER_ID)) {
|
||||
var addl = command.minPwr ? `this command requires a power level of ${command.minPwr}\nyour power level is ${event.sender.powerLevel}` : "this command is owner-only.";
|
||||
|
||||
client.reply(event, addl, '<img src="mxc://possum.city/b4Vo1BTcq49B7TbFWCqq76HQWQEdNIqq" alt="nuh uh" /><br>' + addl);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue