aboutsummaryrefslogtreecommitdiff
path: root/src/commands/admin
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-28 09:27:41 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-28 09:27:41 -0500
commit453683b57b8ff013ff25e2aaa4aa1d2e047edcb7 (patch)
tree8b98d2f30dbb6a8448602446cfacf9091667cc33 /src/commands/admin
parentde4c3dcaf172804d34ae708be1ed3e75af42f4d5 (diff)
downloadtanzanite-453683b57b8ff013ff25e2aaa4aa1d2e047edcb7.tar.gz
tanzanite-453683b57b8ff013ff25e2aaa4aa1d2e047edcb7.tar.bz2
tanzanite-453683b57b8ff013ff25e2aaa4aa1d2e047edcb7.zip
a few small changes
Diffstat (limited to 'src/commands/admin')
-rw-r--r--src/commands/admin/channelPermissions.ts77
-rw-r--r--src/commands/admin/roleAll.ts38
2 files changed, 37 insertions, 78 deletions
diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts
index befa3ea..b44ae21 100644
--- a/src/commands/admin/channelPermissions.ts
+++ b/src/commands/admin/channelPermissions.ts
@@ -7,79 +7,50 @@ export default class ChannelPermissionsCommand extends BushCommand {
aliases: ['channel-perms', 'cperms', 'cperm', 'chanperms', 'chanperm', 'channel-permissions'],
category: 'admin',
typing: true,
- description: {
- content: 'Use to mass change the channel permissions.',
- usage: ['channel-perms <role_id> <perm> <state>'],
- examples: ['channel-perms 783794633129197589 read_messages deny']
- },
+ description: 'Use to mass change the channel permissions.',
+ usage: ['channel-perms <role_id> <perm> <state>'],
+ examples: ['channel-perms 783794633129197589 read_messages deny'],
args: [
{
id: 'target',
- customType: util.arg.union('member', 'member'),
- prompt: {
- start: 'What user/role would you like to change?',
- retry: '{error} Choose a valid user/role to change.'
- }
+ description: 'The user/role to change the permissions of.',
+ customType: util.arg.union('member', 'role'),
+ readableType: 'member|role',
+ prompt: 'What user/role would you like to change?',
+ retry: '{error} Choose a valid user/role to change.',
+ slashType: 'MENTIONABLE'
},
{
id: 'permission',
+ description: 'The permission to change for the target user/role.',
type: 'permission',
- prompt: {
- start: 'What permission would you like to change?',
- retry: '{error} Choose a valid permission.'
- }
+ prompt: 'What permission would you like to change?',
+ retry: '{error} Choose a valid permission.',
+ slashType: 'STRING'
},
{
id: 'state',
+ description: 'The state that the permission should be set to for the target.',
customType: [
['true', '1', 'yes', 'enable', 'allow'],
['false', '0', 'no', 'disable', 'disallow', 'deny'],
['neutral', 'remove', 'none']
],
- prompt: {
- start: 'What should that permission be set to?',
- retry: '{error} Set the state to either `enable`, `disable`, or `remove`.'
- }
+ readableType: "'enable'|'disable'|'remove'",
+ prompt: 'What should that permission be set to?',
+ retry: '{error} Set the state to either `enable`, `disable`, or `remove`.',
+ slashType: 'STRING',
+ choices: [
+ { name: 'Enabled', value: 'true' },
+ { name: 'Disabled', value: 'false' },
+ { name: 'Neutral', value: 'neutral' }
+ ]
}
],
clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_CHANNELS']),
userPermissions: ['ADMINISTRATOR'],
channel: 'guild',
- slash: true,
- slashOptions: [
- {
- name: 'target',
- description: 'What user/role would you like to change?',
- type: 'MENTIONABLE',
- required: true
- },
- {
- name: 'permission',
- description: 'What permission would you like to change?',
- type: 'STRING',
- required: true
- },
- {
- name: 'state',
- description: 'What should that permission be set to?',
- type: 'STRING',
- choices: [
- {
- name: 'Enabled',
- value: 'true'
- },
- {
- name: 'Disabled',
- value: 'false'
- },
- {
- name: 'Neutral',
- value: 'neutral'
- }
- ],
- required: true
- }
- ]
+ slash: true
});
}
diff --git a/src/commands/admin/roleAll.ts b/src/commands/admin/roleAll.ts
index 3c6b629..585e6cc 100644
--- a/src/commands/admin/roleAll.ts
+++ b/src/commands/admin/roleAll.ts
@@ -6,46 +6,34 @@ export default class RoleAllCommand extends BushCommand {
super('roleAll', {
aliases: ['role-all', 'rall'],
category: 'admin',
- description: {
- content: 'Give a role to every member on the server.',
- usage: ['role-all <role> [--bots]'],
- examples: ['role-all 783794633129197589 --bots']
- },
+ description: 'Give a role to every member on the server.',
+ usage: ['role-all <role> [--bots]'],
+ examples: ['role-all 783794633129197589 --bots'],
args: [
{
id: 'role',
+ description: 'The role to assigned to every member on the server.',
type: 'role',
- prompt: {
- start: 'What role would you like to give to every member on the server?',
- retry: '{error} Pick a valid role.'
- }
+ prompt: 'What role would you like to give to every member on the server?',
+ retry: '{error} Pick a valid role.',
+ slashType: 'ROLE'
},
{
id: 'bots',
+ description: 'Also give the role to bots.',
match: 'flag',
+ prompt: 'Would you like to also give roles to bots?',
flag: '--bots',
- default: false
+ default: false,
+ slashType: 'BOOLEAN',
+ optional: true
}
],
channel: 'guild',
clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_ROLES']),
userPermissions: ['ADMINISTRATOR'],
typing: true,
- slash: true,
- slashOptions: [
- {
- name: 'role',
- description: 'What role would you like to give to every member on the server?',
- type: 'ROLE',
- required: true
- },
- {
- name: 'bots',
- description: 'Would you like to also give roles to bots?',
- type: 'BOOLEAN',
- required: false
- }
- ]
+ slash: true
});
}