perm types
This commit is contained in:
parent
e1c2f4a554
commit
343f451541
@ -0,0 +1,53 @@
|
||||
const { Setting, CommandOption } = require('../../../interfaces/');
|
||||
|
||||
class PermissionType extends Setting {
|
||||
|
||||
constructor(client) {
|
||||
|
||||
super(client, {
|
||||
name: 'permissions',
|
||||
description: 'Change between discord and bot based permissions',
|
||||
module: 'administration',
|
||||
display: 'Permission Type',
|
||||
default: {
|
||||
type: 'discord'
|
||||
},
|
||||
definitions: {
|
||||
type: 'STRING'
|
||||
},
|
||||
commandOptions: [
|
||||
new CommandOption({
|
||||
type: 'STRING',
|
||||
name: 'type',
|
||||
choices: [
|
||||
{ name: 'discord', value: 'discord' },
|
||||
{ name: 'both', value: 'both' },
|
||||
{ name: 'grant', value: 'grant' }
|
||||
]
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async execute(interaction, opts, setting) {
|
||||
|
||||
const { type } = opts;
|
||||
setting.type = type.value;
|
||||
return { index: 'SETTING_SUCCESS_ALT' };
|
||||
|
||||
}
|
||||
|
||||
async fields(guild) {
|
||||
const setting = guild._settings[this.name];
|
||||
return [
|
||||
{
|
||||
name: 'SETTING_PERMISSION_TYPE_FIELD',
|
||||
value: '`' + setting.type + '`'
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = PermissionType;
|
Loading…
Reference in New Issue
Block a user