From e4383622096da129c5bae97bf4765488cc9e1431 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 29 Mar 2022 01:49:18 +0300 Subject: [PATCH] start on grant command --- .../commands/administration/Grant.js | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/structure/components/commands/administration/Grant.js diff --git a/src/structure/components/commands/administration/Grant.js b/src/structure/components/commands/administration/Grant.js new file mode 100644 index 0000000..72d8dae --- /dev/null +++ b/src/structure/components/commands/administration/Grant.js @@ -0,0 +1,53 @@ +const { SlashCommand, CommandOption } = require("../../../interfaces"); + +class GrantCommand extends SlashCommand { + + constructor(client) { + super(client, { + name: 'grant', + description: 'Grant permissions to users and or roles', + module: 'administration', + options: [ + new CommandOption({ + name: 'channel', + description: 'The channel(s) in which this permission is granted to user or role', + type: 'TEXT_CHANNELS', + dependsOn: ['permission'] + }), + new CommandOption({ + name: 'role', + description: 'The role(s) to which this permission is granted to', + type: 'ROLES', + dependsOn: ['permission'] + }), + new CommandOption({ + name: 'member', + description: 'The member(s) to which this permission is granted to', + type: 'MEMBERS', + dependsOn: ['permission'] + }), + new CommandOption({ + name: 'permissions', + description: 'Which permission(s) to grant', + type: 'STRING', + dependsOn: ['member', 'role'], + dependsOnMode: 'OR' + }) + ], + guildOnly: true, + memberPermissions: ['MANAGE_GUILD'], + showUsage: true + }); + } + + async execute(interaction, { role, channel, member }) { + + const { guild } = interaction; + const perms = await guild.permissions(); + const grantables = this.client.registry.components.filter((c) => ['command', 'module'].includes(c._type)); + + } + +} + +module.exports = GrantCommand; \ No newline at end of file