Finally realise I mistype BotPerms in kick command and wtf discord devs removed command perms!?!?!?!?!
This commit is contained in:
parent
868d66acda
commit
092581c5fb
2 changed files with 23 additions and 24 deletions
|
@ -3,7 +3,7 @@ module.exports = {
|
||||||
name: "kick",
|
name: "kick",
|
||||||
description: "Kick an user",
|
description: "Kick an user",
|
||||||
UserPerms: ["KICK_MEMBERS"],
|
UserPerms: ["KICK_MEMBERS"],
|
||||||
BotPems: ["KICK_MEMBERS"],
|
BotPerms: ["KICK_MEMBERS"],
|
||||||
usage: "(User) {Reason}",
|
usage: "(User) {Reason}",
|
||||||
category: "Moderation",
|
category: "Moderation",
|
||||||
options: [
|
options: [
|
||||||
|
|
45
util/dist/handler.js
vendored
45
util/dist/handler.js
vendored
|
@ -29,28 +29,27 @@ module.exports = async client => {
|
||||||
});
|
});
|
||||||
client.on("ready", async () => {
|
client.on("ready", async () => {
|
||||||
await client.guilds.cache.get("840225563193114624").commands.set(ownercmds);
|
await client.guilds.cache.get("840225563193114624").commands.set(ownercmds);
|
||||||
await client.application.commands
|
await client.application.commands.set(cmds);
|
||||||
.set(cmds)
|
// .then(async cmd => {
|
||||||
.then(async cmd => {
|
// client.guilds.cache.forEach(g => {
|
||||||
client.guilds.cache.forEach(g => {
|
// const getroles = name => {
|
||||||
const getroles = name => {
|
// const perms = cmds.find(n => n.name == name).UserPerms;
|
||||||
const perms = cmds.find(n => n.name == name).UserPerms;
|
// if (!perms) return null;
|
||||||
if (!perms) return null;
|
// return g.roles.cache.filter(
|
||||||
return g.roles.cache.filter(
|
// z => z.permissions.has(perms) && !z.managed
|
||||||
z => z.permissions.has(perms) && !z.managed
|
// );
|
||||||
);
|
// };
|
||||||
};
|
// const fullPermissions = cmd.reduce((accumulator, v) => {
|
||||||
const fullPermissions = cmd.reduce((accumulator, v) => {
|
// const roles = getroles(v.name);
|
||||||
const roles = getroles(v.name);
|
// if (!roles) return accumulator;
|
||||||
if (!roles) return accumulator;
|
// const permissions = roles.reduce((a, w) => {
|
||||||
const permissions = roles.reduce((a, w) => {
|
// return [...a, { id: w.id, type: "ROLE", permission: true }];
|
||||||
return [...a, { id: w.id, type: "ROLE", permission: true }];
|
// }, []);
|
||||||
}, []);
|
// return [...accumulator, { id: v.id, permissions }];
|
||||||
return [...accumulator, { id: v.id, permissions }];
|
// }, []);
|
||||||
}, []);
|
// g.commands.permissions.set({ fullPermissions }).catch(null);
|
||||||
g.commands.permissions.set({ fullPermissions }).catch(null);
|
// });
|
||||||
});
|
// })
|
||||||
})
|
// .catch(null);
|
||||||
.catch(null);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue