start on grant command

This commit is contained in:
Erik 2022-03-29 01:49:18 +03:00
parent dd10fc7c09
commit e438362209
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View 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;