aboutsummaryrefslogtreecommitdiff
path: root/src/commands/utilities/decode.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-21 00:05:53 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-21 00:05:53 -0400
commit166d7fdf24440db71311c2cda95697c06e7b8b36 (patch)
tree23b0400362b5f3035b156200eb634d202aa54741 /src/commands/utilities/decode.ts
parent08f33f7d450c8920afc3b9fb8886729547065313 (diff)
downloadtanzanite-166d7fdf24440db71311c2cda95697c06e7b8b36.tar.gz
tanzanite-166d7fdf24440db71311c2cda95697c06e7b8b36.tar.bz2
tanzanite-166d7fdf24440db71311c2cda95697c06e7b8b36.zip
Refactoring, rewrote ButtonPaginator, better permission handling + support for send messages in threads, optimizations, another scam link
Diffstat (limited to 'src/commands/utilities/decode.ts')
-rw-r--r--src/commands/utilities/decode.ts33
1 files changed, 6 insertions, 27 deletions
diff --git a/src/commands/utilities/decode.ts b/src/commands/utilities/decode.ts
index e48c644..c497183 100644
--- a/src/commands/utilities/decode.ts
+++ b/src/commands/utilities/decode.ts
@@ -3,7 +3,7 @@ import { AkairoMessage } from 'discord-akairo';
import { MessageEmbed } from 'discord.js';
const encodingTypesArray = ['ascii', 'utf8', 'utf-8', 'utf16le', 'ucs2', 'ucs-2', 'base64', 'latin1', 'binary', 'hex'];
-const encodingTypesString = '`ascii`, `utf8`, `utf-8`, `utf16le`, `ucs2`, `ucs-2`, `base64`, `latin1`, `binary`, `hex`';
+const encodingTypesString = encodingTypesArray.map((e) => `\`${e}\``).join(', ');
export default class DecodeCommand extends BushCommand {
public constructor() {
@@ -42,43 +42,20 @@ export default class DecodeCommand extends BushCommand {
}
}
],
- clientPermissions: ['SEND_MESSAGES'],
slash: true,
slashOptions: [
{
name: 'from',
description: 'The type of data you are inputting.',
type: 'STRING',
- choices: [
- { name: 'ascii', value: 'ascii' },
- { name: 'utf8', value: 'utf8' },
- { name: 'utf-8', value: 'utf-8' },
- { name: 'utf16le', value: 'utf16le' },
- { name: 'ucs2', value: 'ucs2' },
- { name: 'ucs-2', value: 'ucs-2' },
- { name: 'base64', value: 'base64' },
- { name: 'latin1', value: 'latin1' },
- { name: 'binary', value: 'binary' },
- { name: 'hex', value: 'hex' }
- ],
+ choices: encodingTypesArray.map((e) => ({ name: e, value: e })),
required: true
},
{
name: 'to',
description: 'The type of data you want the output to be.',
type: 'STRING',
- choices: [
- { name: 'ascii', value: 'ascii' },
- { name: 'utf8', value: 'utf8' },
- { name: 'utf-8', value: 'utf-8' },
- { name: 'utf16le', value: 'utf16le' },
- { name: 'ucs2', value: 'ucs2' },
- { name: 'ucs-2', value: 'ucs-2' },
- { name: 'base64', value: 'base64' },
- { name: 'latin1', value: 'latin1' },
- { name: 'binary', value: 'binary' },
- { name: 'hex', value: 'hex' }
- ],
+ choices: encodingTypesArray.map((e) => ({ name: e, value: e })),
required: true
},
{
@@ -87,7 +64,9 @@ export default class DecodeCommand extends BushCommand {
type: 'STRING',
required: true
}
- ]
+ ],
+ clientPermissions: (m) => util.clientSendAndPermCheck(m),
+ userPermissions: []
});
}