nyx

The first CODM discrod bot -- cath.exe Template
git clone https://codeberg.org/night0721/nyx
Log | Files | Refs | LICENSE

commit 092581c5fb90f8af5f7e96ad403693e8e9955f0b
parent 868d66acda6313dfd888bd169419d2876915712d
Author: night0721 <[email protected]>
Date:   Sat,  2 Jul 2022 10:06:48 +0100

Finally realise I mistype BotPerms in kick command and wtf discord devs removed command perms!?!?!?!?!

Diffstat:
Mcommand/Moderation/kick.js | 2+-
Mutil/dist/handler.js | 45++++++++++++++++++++++-----------------------
2 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/command/Moderation/kick.js b/command/Moderation/kick.js @@ -3,7 +3,7 @@ module.exports = { name: "kick", description: "Kick an user", UserPerms: ["KICK_MEMBERS"], - BotPems: ["KICK_MEMBERS"], + BotPerms: ["KICK_MEMBERS"], usage: "(User) {Reason}", category: "Moderation", options: [ diff --git a/util/dist/handler.js b/util/dist/handler.js @@ -29,28 +29,27 @@ module.exports = async client => { }); client.on("ready", async () => { await client.guilds.cache.get("840225563193114624").commands.set(ownercmds); - await client.application.commands - .set(cmds) - .then(async cmd => { - client.guilds.cache.forEach(g => { - const getroles = name => { - const perms = cmds.find(n => n.name == name).UserPerms; - if (!perms) return null; - return g.roles.cache.filter( - z => z.permissions.has(perms) && !z.managed - ); - }; - const fullPermissions = cmd.reduce((accumulator, v) => { - const roles = getroles(v.name); - if (!roles) return accumulator; - const permissions = roles.reduce((a, w) => { - return [...a, { id: w.id, type: "ROLE", permission: true }]; - }, []); - return [...accumulator, { id: v.id, permissions }]; - }, []); - g.commands.permissions.set({ fullPermissions }).catch(null); - }); - }) - .catch(null); + await client.application.commands.set(cmds); + // .then(async cmd => { + // client.guilds.cache.forEach(g => { + // const getroles = name => { + // const perms = cmds.find(n => n.name == name).UserPerms; + // if (!perms) return null; + // return g.roles.cache.filter( + // z => z.permissions.has(perms) && !z.managed + // ); + // }; + // const fullPermissions = cmd.reduce((accumulator, v) => { + // const roles = getroles(v.name); + // if (!roles) return accumulator; + // const permissions = roles.reduce((a, w) => { + // return [...a, { id: w.id, type: "ROLE", permission: true }]; + // }, []); + // return [...accumulator, { id: v.id, permissions }]; + // }, []); + // g.commands.permissions.set({ fullPermissions }).catch(null); + // }); + // }) + // .catch(null); }); };