mirror of
https://github.com/litruv/DAdmin.git
synced 2026-07-26 03:36:13 +10:00
Permissions check on DM's
This commit is contained in:
5
index.js
5
index.js
@@ -125,6 +125,7 @@ function doPMCommand(msg, prefix) {
|
||||
if (cmds.length > 0) {
|
||||
console.log("CMD:".green + " ".reset + msg.author.username.bold + "#".reset + msg.author.discriminator.reset + " " + prefix.grey + command.green.bold + " ".reset + msg.suffix + " | PM")
|
||||
var reqcommand = require('./commands/' + cmds[0].file)
|
||||
if (reqcommand.permissions == ['READ_MESSAGES']) {
|
||||
msg.react('✅')
|
||||
try {
|
||||
reqcommand.command(client, msg)
|
||||
@@ -132,7 +133,11 @@ function doPMCommand(msg, prefix) {
|
||||
console.error('There was an error running: ' + command);
|
||||
console.error(err.stack);
|
||||
}
|
||||
} else {
|
||||
msg.react('⛔')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
delete require.cache[require.resolve('./commands/' + cmds[0].file)]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user