aboutsummaryrefslogtreecommitdiff
path: root/src/commands/config/prefix.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-06-24 00:56:16 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-06-24 00:56:16 -0400
commit4176b6258e44e4a095376aaf0f4c687244243a69 (patch)
tree3b9144be9a2045483c90d92fff05b3ca0b288e52 /src/commands/config/prefix.ts
parente80446e23060c0325bbd6db620920d86694ec3ce (diff)
downloadtanzanite-4176b6258e44e4a095376aaf0f4c687244243a69.tar.gz
tanzanite-4176b6258e44e4a095376aaf0f4c687244243a69.tar.bz2
tanzanite-4176b6258e44e4a095376aaf0f4c687244243a69.zip
feat(*): Began working on other punishment commands etc
Diffstat (limited to 'src/commands/config/prefix.ts')
-rw-r--r--src/commands/config/prefix.ts16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/commands/config/prefix.ts b/src/commands/config/prefix.ts
index 1326426..5b73a1a 100644
--- a/src/commands/config/prefix.ts
+++ b/src/commands/config/prefix.ts
@@ -1,6 +1,6 @@
-import { Message } from 'discord.js';
import { BushCommand } from '../../lib/extensions/BushCommand';
import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage';
+import { BushMessage } from '../../lib/extensions/BushMessage';
import { Guild } from '../../lib/models';
export default class PrefixCommand extends BushCommand {
@@ -11,10 +11,16 @@ export default class PrefixCommand extends BushCommand {
args: [
{
id: 'prefix',
- type: 'string'
+ type: 'string',
+ prompt: {
+ start: 'What would you like the new prefix to be?',
+ retry: '{error} Choose a valid prefix',
+ optional: true
+ }
}
],
- userPermissions: ['MANAGE_GUILD'],
+ clientPermissions: ['SEND_MESSAGES'],
+ userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'],
description: {
content: 'Set the prefix of the current server (resets to default if prefix is not given)',
usage: 'prefix [prefix]',
@@ -32,7 +38,7 @@ export default class PrefixCommand extends BushCommand {
});
}
- async exec(message: Message | BushSlashMessage, { prefix }: { prefix?: string }): Promise<void> {
+ async exec(message: BushMessage | BushSlashMessage, { prefix }: { prefix?: string }): Promise<void> {
let row = await Guild.findByPk(message.guild.id);
if (!row) {
row = Guild.build({
@@ -41,7 +47,7 @@ export default class PrefixCommand extends BushCommand {
}
await row.update({ prefix: prefix || this.client.config.prefix });
if (prefix) {
- await message.util.send(`${this.client.util.emojis.success} changed prefix from \`${prefix}\``);
+ await message.util.send(`${this.client.util.emojis.success} changed prefix from \`${prefix}\` to `);
} else {
await message.util.send(`${this.client.util.emojis.success} reset prefix to \`${this.client.config.prefix}\``);
}