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