diff --git a/commands/toggle.js b/commands/toggle.js index eb82469..791b19c 100644 --- a/commands/toggle.js +++ b/commands/toggle.js @@ -46,7 +46,7 @@ export default { command: "toggle", name: "toggle", usage: "", - admin: true, + minPwr: 50, desc: "toggle a module on or off in current channel", execute } diff --git a/index.js b/index.js index 91435d4..46384dd 100644 --- a/index.js +++ b/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, 'nuh uh
' + addl); return true; }