start on grant command
This commit is contained in:
parent
dd10fc7c09
commit
e438362209
53
src/structure/components/commands/administration/Grant.js
Normal file
53
src/structure/components/commands/administration/Grant.js
Normal file
@ -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;
|
Loading…
Reference in New Issue
Block a user