mirror of
https://github.com/litruv/DAdmin.git
synced 2026-07-24 02:36:11 +10:00
permissions, category set
This commit is contained in:
@@ -6,6 +6,7 @@ module.exports = {
|
|||||||
alias: ['help', '?'],
|
alias: ['help', '?'],
|
||||||
helptext: "Runs this help menu",
|
helptext: "Runs this help menu",
|
||||||
permissions: ['VIEW_CHANNEL'],
|
permissions: ['VIEW_CHANNEL'],
|
||||||
|
category: 'general',
|
||||||
args: ['(general)/music/admin'],
|
args: ['(general)/music/admin'],
|
||||||
command: (client, msg) => {
|
command: (client, msg) => {
|
||||||
fs.readdir("./commands/", function (err, items) {
|
fs.readdir("./commands/", function (err, items) {
|
||||||
@@ -61,10 +62,11 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
description += "```apache\n"
|
description += "```apache\n"
|
||||||
for (var z = 0; z < reqcommand.alias.length; z++) {
|
for (var z = 0; z < reqcommand.alias.length; z++) {
|
||||||
description += client.cachedserversettings.filter(function (server) {
|
if (msg.channel.type != "dm") {
|
||||||
return server.guildID == msg.guild.id;
|
description += client.cachedserversettings.filter(function (server) {
|
||||||
})[0].prefix
|
return server.guildID == msg.guild.id;
|
||||||
|
})[0].prefix
|
||||||
|
}
|
||||||
description += reqcommand.alias[z] + " ";
|
description += reqcommand.alias[z] + " ";
|
||||||
if (z != reqcommand.alias.length - 1)
|
if (z != reqcommand.alias.length - 1)
|
||||||
description += "/ ";
|
description += "/ ";
|
||||||
|
|||||||
4
index.js
4
index.js
@@ -92,7 +92,7 @@ client.on("message", (msg) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function onMessage(msg, again = true) {
|
function onMessage(msg, again = true) {
|
||||||
if (msg.channel.type = "dm") {
|
if (msg.channel.type == "dm") {
|
||||||
doPMCommand(msg, "")
|
doPMCommand(msg, "")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -125,7 +125,7 @@ function doPMCommand(msg, prefix) {
|
|||||||
if (cmds.length > 0) {
|
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")
|
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)
|
var reqcommand = require('./commands/' + cmds[0].file)
|
||||||
if (reqcommand.permissions == 'READ_MESSAGES') {
|
if (reqcommand.category == 'general') {
|
||||||
msg.react('✅')
|
msg.react('✅')
|
||||||
try {
|
try {
|
||||||
reqcommand.command(client, msg)
|
reqcommand.command(client, msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user