aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/config/muteRole.ts21
-rw-r--r--src/commands/config/prefix.ts49
-rw-r--r--src/commands/config/welcomeChannel.ts63
-rw-r--r--src/commands/dev/eval.ts19
-rw-r--r--src/commands/dev/reload.ts26
-rw-r--r--src/commands/dev/setLevel.ts22
-rw-r--r--src/commands/dev/superUser.ts6
-rw-r--r--src/commands/info/help.ts5
-rw-r--r--src/commands/info/ping.ts2
-rw-r--r--src/commands/info/pronouns.ts60
-rw-r--r--src/commands/moderation/ban.ts7
-rw-r--r--src/commands/moderation/kick.ts7
-rw-r--r--src/commands/moderation/mute.ts7
-rw-r--r--src/commands/moderation/role.ts5
-rw-r--r--src/commands/moulberry-bush/capePerms.ts3
-rw-r--r--src/commands/moulberry-bush/level.ts5
-rw-r--r--src/commands/moulberry-bush/rule.ts5
17 files changed, 155 insertions, 157 deletions
diff --git a/src/commands/config/muteRole.ts b/src/commands/config/muteRole.ts
index f51c5ce..a354bcc 100644
--- a/src/commands/config/muteRole.ts
+++ b/src/commands/config/muteRole.ts
@@ -1,8 +1,8 @@
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { Role } 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';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
import AllowedMentions from '../../lib/utils/AllowedMentions';
export default class MuteRoleCommand extends BushCommand {
@@ -11,7 +11,7 @@ export default class MuteRoleCommand extends BushCommand {
aliases: ['muterole'],
category: 'config',
description: {
- content: 'Set the prefix of the current server (resets to default if prefix is not given)',
+ content: 'Configure what role to use when muting users.',
usage: 'prefix [prefix]',
examples: ['prefix', 'prefix +']
},
@@ -31,9 +31,9 @@ export default class MuteRoleCommand extends BushCommand {
slash: true,
slashOptions: [
{
- type: 'ROLE',
+ type: ApplicationCommandOptionType.ROLE,
name: 'role',
- description: 'The mute role for this server.',
+ description: "What would you like to set the server's mute role to?",
required: true
}
]
@@ -41,16 +41,9 @@ export default class MuteRoleCommand extends BushCommand {
}
async exec(message: BushMessage | BushSlashMessage, args: { role: Role }): Promise<void> {
- let row = await Guild.findByPk(message.guild.id);
- if (!row) {
- row = Guild.build({
- id: message.guild.id
- });
- }
- row.muteRole = args.role.id;
- await row.save();
+ await message.guild.setSetting('muteRole', args.role.id);
await message.util.send({
- content: `${this.client.util.emojis.success} Changed the mute role to <@&${args.role.id}>.`,
+ content: `${this.client.util.emojis.success} Changed the server's mute role to <@&${args.role.id}>.`,
allowedMentions: AllowedMentions.none()
});
}
diff --git a/src/commands/config/prefix.ts b/src/commands/config/prefix.ts
index 5b73a1a..fc7b3bf 100644
--- a/src/commands/config/prefix.ts
+++ b/src/commands/config/prefix.ts
@@ -1,13 +1,20 @@
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { BushCommand } from '../../lib/extensions/BushCommand';
-import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage';
import { BushMessage } from '../../lib/extensions/BushMessage';
-import { Guild } from '../../lib/models';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
export default class PrefixCommand extends BushCommand {
constructor() {
super('prefix', {
aliases: ['prefix'],
category: 'config',
+ description: {
+ content: 'Set or reset the prefix for the server.',
+ usage: 'prefix [prefix]',
+ examples: ['prefix', 'prefix +']
+ },
+ clientPermissions: ['SEND_MESSAGES'],
+ userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'],
args: [
{
id: 'prefix',
@@ -19,37 +26,31 @@ export default class PrefixCommand extends BushCommand {
}
}
],
- 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]',
- examples: ['prefix', 'prefix +']
- },
+ slash: true,
slashOptions: [
{
- type: 'STRING',
+ type: ApplicationCommandOptionType.STRING,
name: 'prefix',
- description: 'The prefix to set for this server',
+ description: 'What would you like the new prefix to be?',
required: false
}
- ],
- slash: true
+ ]
});
}
- async exec(message: BushMessage | BushSlashMessage, { prefix }: { prefix?: string }): Promise<void> {
- let row = await Guild.findByPk(message.guild.id);
- if (!row) {
- row = Guild.build({
- id: message.guild.id
- });
- }
- await row.update({ prefix: prefix || this.client.config.prefix });
- if (prefix) {
- await message.util.send(`${this.client.util.emojis.success} changed prefix from \`${prefix}\` to `);
+ async exec(message: BushMessage | BushSlashMessage, args: { prefix?: string }): Promise<unknown> {
+ const oldPrefix = message.guild.getSetting('prefix');
+ await message.guild.setSetting('prefix', args.prefix ?? this.client.config.prefix);
+ if (args.prefix) {
+ return await message.util.send(
+ `${this.client.util.emojis.success} changed the server's prefix ${oldPrefix ? `from \`${oldPrefix}\`` : ''} to \`${
+ args.prefix
+ }\`.`
+ );
} else {
- await message.util.send(`${this.client.util.emojis.success} reset prefix to \`${this.client.config.prefix}\``);
+ return await message.util.send(
+ `${this.client.util.emojis.success} reset the server's prefix to \`${this.client.config.prefix}\`.`
+ );
}
}
}
diff --git a/src/commands/config/welcomeChannel.ts b/src/commands/config/welcomeChannel.ts
index 72e55f1..8cab33c 100644
--- a/src/commands/config/welcomeChannel.ts
+++ b/src/commands/config/welcomeChannel.ts
@@ -1,7 +1,8 @@
-import { User } from 'discord.js';
+import { ApplicationCommandOptionType } from 'discord-api-types';
+import { Channel } from 'discord.js';
import { BushCommand } from '../../lib/extensions/BushCommand';
import { BushMessage } from '../../lib/extensions/BushMessage';
-import { Global } from '../../lib/models';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
export default class WelcomeChannelCommand extends BushCommand {
public constructor() {
@@ -9,41 +10,45 @@ export default class WelcomeChannelCommand extends BushCommand {
aliases: ['welcomechannel', 'wc'],
category: 'config',
description: {
- content: 'Configure the what channel you want the bot to send a message in when someone joins the server.',
+ content: 'Configure the what channel you want BushBot to send a message in when someone joins the server.',
usage: 'welcomechannel [channel]',
examples: ['welcomechannel #welcome']
},
clientPermissions: ['SEND_MESSAGES'],
- ownerOnly: true
+ userPermissions: ['SEND_MESSAGES', 'MANAGE_GUILD'],
+ args: [
+ {
+ id: 'channel',
+ type: 'channel',
+ prompt: {
+ start: 'What channel would you like me to send welcome messages in?',
+ retry: '{error} Choose a valid channel',
+ optional: true
+ }
+ }
+ ],
+ slash: true,
+ slashOptions: [
+ {
+ type: ApplicationCommandOptionType.CHANNEL,
+ name: 'channel',
+ description: 'What channel would you like me to send welcome messages in?',
+ required: false
+ }
+ ]
});
}
- public async exec(message: BushMessage, args: { action: 'add' | 'remove'; user: User }): Promise<unknown> {
- if (!this.client.config.owners.includes(message.author.id))
- return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command...`);
-
- const superUsers = (await Global.findByPk(this.client.config.dev ? 'development' : 'production')).superUsers;
- let success;
- if (args.action === 'add') {
- if (superUsers.includes(args.user.id)) {
- return message.util.reply(`${this.client.util.emojis.warn} \`${args.user.tag}\` is already a superuser.`);
- }
- success = await this.client.util.insertOrRemoveFromGlobal('add', 'superUsers', args.user.id).catch(() => false);
- } else {
- if (!superUsers.includes(args.user.id)) {
- return message.util.reply(`${this.client.util.emojis.warn} \`${args.user.tag}\` is not superuser.`);
- }
- success = await this.client.util.insertOrRemoveFromGlobal('remove', 'superUsers', args.user.id).catch(() => false);
- }
- if (success) {
- const responses = [args.action == 'remove' ? `` : 'made', args.action == 'remove' ? 'is no longer' : ''];
- return message.util.reply(
- `${this.client.util.emojis.success} ${responses[0]} \`${args.user.tag}\` ${responses[1]} a superuser.`
+ public async exec(message: BushMessage | BushSlashMessage, args: { channel: Channel }): Promise<unknown> {
+ const oldChannel = await message.guild.getSetting('welcomeChannel');
+ await message.guild.setSetting('welcomeChannel', args.channel.id ?? undefined);
+ if (args.channel) {
+ return await message.util.send(
+ `${this.client.util.emojis.success} changed the server's welcome channel ${
+ oldChannel ? `from <#${oldChannel}>` : ''
+ } to <#${args.channel.id}>.`
);
} else {
- const response = [args.action == 'remove' ? `removing` : 'making', args.action == 'remove' ? `from` : 'to'];
- return message.util.reply(
- `${this.client.util.emojis.error} There was an error ${response[0]} \`${args.user.tag}\` ${response[1]} the superuser list.`
- );
+ return await message.util.send(`${this.client.util.emojis.success} removed the server's welcome channel.`);
}
}
}
diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts
index 310a2c5..04c5158 100644
--- a/src/commands/dev/eval.ts
+++ b/src/commands/dev/eval.ts
@@ -1,12 +1,13 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { exec } from 'child_process';
import { Constants } from 'discord-akairo';
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { CommandInteraction, MessageEmbed, MessageEmbedOptions, Util } from 'discord.js';
import { transpile } from 'typescript';
import { inspect, promisify } from 'util';
import { BushCommand } from '../../lib/extensions/BushCommand';
-import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage';
import { BushMessage } from '../../lib/extensions/BushMessage';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
const clean = (text) => {
if (typeof text === 'string') {
@@ -79,43 +80,43 @@ export default class EvalCommand extends BushCommand {
{
name: 'code',
description: 'The code you would like to evaluate.',
- type: 'STRING',
+ type: ApplicationCommandOptionType.STRING,
required: true
},
{
name: 'sel_depth',
description: 'How deep to display the output.',
- type: 'INTEGER',
+ type: ApplicationCommandOptionType.INTEGER,
required: false
},
{
name: 'sudo',
description: 'Whether or not to override checks.',
- type: 'BOOLEAN',
+ type: ApplicationCommandOptionType.BOOLEAN,
required: false
},
{
name: 'silent',
description: 'Whether or not to make the response silent',
- type: 'BOOLEAN',
+ type: ApplicationCommandOptionType.BOOLEAN,
required: false
},
{
name: 'typescript',
description: 'Whether or not to compile the code from typescript.',
- type: 'BOOLEAN',
+ type: ApplicationCommandOptionType.BOOLEAN,
required: false
},
{
name: 'hidden',
description: 'Whether or not to show hidden items.',
- type: 'BOOLEAN',
+ type: ApplicationCommandOptionType.BOOLEAN,
required: false
},
{
name: 'show_proto',
description: 'Show prototype.',
- type: 'BOOLEAN',
+ type: ApplicationCommandOptionType.BOOLEAN,
required: false
}
]
@@ -135,7 +136,7 @@ export default class EvalCommand extends BushCommand {
show_proto: boolean;
}
): Promise<unknown> {
- if (!this.client.config.owners.includes(message.author.id))
+ if (!message.author.isOwner())
return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command.`);
if (message.util.isSlash) {
await (message as BushSlashMessage).interaction.defer({ ephemeral: args.silent });
diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts
index f5fee88..07218f2 100644
--- a/src/commands/dev/reload.ts
+++ b/src/commands/dev/reload.ts
@@ -1,7 +1,7 @@
-import { stripIndent } from 'common-tags';
-import { Message } from 'discord.js';
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { BushCommand } from '../../lib/extensions/BushCommand';
-import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage';
+import { BushMessage } from '../../lib/extensions/BushMessage';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
export default class ReloadCommand extends BushCommand {
constructor() {
@@ -24,7 +24,7 @@ export default class ReloadCommand extends BushCommand {
typing: true,
slashOptions: [
{
- type: 'BOOLEAN',
+ type: ApplicationCommandOptionType.BOOLEAN,
name: 'fast',
description: 'Whether to use esbuild for fast compiling or not',
required: false
@@ -34,23 +34,21 @@ export default class ReloadCommand extends BushCommand {
});
}
- private async getResponse(fast: boolean): Promise<string> {
+ public async exec(message: BushMessage | BushSlashMessage, { fast }: { fast: boolean }): Promise<unknown> {
+ if (!message.author.isOwner())
+ return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command.`);
+
try {
const s = new Date();
await this.client.util.shell(`yarn build-${fast ? 'esbuild' : 'tsc'}`);
this.client.commandHandler.reloadAll();
this.client.listenerHandler.reloadAll();
this.client.inhibitorHandler.reloadAll();
- return `🔁 Successfully reloaded! (${new Date().getTime() - s.getTime()}ms)`;
+ return message.util.send(`🔁 Successfully reloaded! (${new Date().getTime() - s.getTime()}ms)`);
} catch (e) {
- return stripIndent`
- An error occured while reloading:
- ${await this.client.util.haste(e.stack)}
- `;
+ return message.util.send(
+ `An error occurred while reloading:\n${await this.client.util.codeblock(e.stack, 2048 - 34, 'js')}`
+ );
}
}
-
- public async exec(message: Message | BushSlashMessage, { fast }: { fast: boolean }): Promise<void> {
- await message.util.send(await this.getResponse(fast));
- }
}
diff --git a/src/commands/dev/setLevel.ts b/src/commands/dev/setLevel.ts
index f536109..7e07ce0 100644
--- a/src/commands/dev/setLevel.ts
+++ b/src/commands/dev/setLevel.ts
@@ -1,5 +1,8 @@
-import { Message, User } from 'discord.js';
+import { ApplicationCommandOptionType } from 'discord-api-types';
+import { User } from 'discord.js';
import { BushCommand } from '../../lib/extensions/BushCommand';
+import { BushMessage } from '../../lib/extensions/BushMessage';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
import { Level } from '../../lib/models';
import AllowedMentions from '../../lib/utils/AllowedMentions';
@@ -34,13 +37,13 @@ export default class SetLevelCommand extends BushCommand {
ownerOnly: true,
slashOptions: [
{
- type: 'USER',
+ type: /* 'USER' */ ApplicationCommandOptionType.USER,
name: 'user',
description: 'The user to change the level of',
required: true
},
{
- type: 'INTEGER',
+ type: /* 'INTEGER' */ ApplicationCommandOptionType.INTEGER,
name: 'level',
description: 'The level to set the user to',
required: true
@@ -50,7 +53,10 @@ export default class SetLevelCommand extends BushCommand {
});
}
- private async setLevel(user: User, level: number): Promise<string> {
+ async exec(message: BushMessage | BushSlashMessage, { user, level }: { user: User; level: number }): Promise<unknown> {
+ if (!message.author.isOwner())
+ return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command.`);
+
const [levelEntry] = await Level.findOrBuild({
where: {
id: user.id
@@ -60,12 +66,8 @@ export default class SetLevelCommand extends BushCommand {
}
});
await levelEntry.update({ xp: Level.convertLevelToXp(level) });
- return `Successfully set level of <@${user.id}> to \`${level}\` (\`${levelEntry.xp}\` XP)`;
- }
-
- async exec(message: Message, { user, level }: { user: User; level: number }): Promise<void> {
- await message.util.send({
- content: await this.setLevel(user, level),
+ return await message.util.send({
+ content: `Successfully set level of <@${user.id}> to \`${level}\` (\`${levelEntry.xp}\` XP)`,
allowedMentions: AllowedMentions.none()
});
}
diff --git a/src/commands/dev/superUser.ts b/src/commands/dev/superUser.ts
index 4562e6f..773209c 100644
--- a/src/commands/dev/superUser.ts
+++ b/src/commands/dev/superUser.ts
@@ -42,8 +42,8 @@ export default class SuperUserCommand extends BushCommand {
return { action, user };
}
public async exec(message: BushMessage, args: { action: 'add' | 'remove'; user: User }): Promise<unknown> {
- if (!this.client.config.owners.includes(message.author.id))
- return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command...`);
+ if (!message.author.isOwner())
+ return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command.`);
const superUsers = (await Global.findByPk(this.client.config.dev ? 'development' : 'production')).superUsers;
let success;
@@ -59,7 +59,7 @@ export default class SuperUserCommand extends BushCommand {
success = await this.client.util.insertOrRemoveFromGlobal('remove', 'superUsers', args.user.id).catch(() => false);
}
if (success) {
- const responses = [args.action == 'remove' ? `` : 'made', args.action == 'remove' ? 'is no longer' : ''];
+ const responses = [args.action == 'remove' ? '' : 'made', args.action == 'remove' ? 'is no longer' : ''];
return message.util.reply(
`${this.client.util.emojis.success} ${responses[0]} \`${args.user.tag}\` ${responses[1]} a superuser.`
);
diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts
index 8969efc..30606e1 100644
--- a/src/commands/info/help.ts
+++ b/src/commands/info/help.ts
@@ -1,7 +1,8 @@
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { MessageActionRow, MessageButton, MessageEmbed } from 'discord.js';
import { BushCommand } from '../../lib/extensions/BushCommand';
-import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage';
import { BushMessage } from '../../lib/extensions/BushMessage';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
export default class HelpCommand extends BushCommand {
constructor() {
@@ -35,7 +36,7 @@ export default class HelpCommand extends BushCommand {
slash: true,
slashOptions: [
{
- type: 'STRING',
+ type: ApplicationCommandOptionType.STRING,
name: 'command',
description: 'The command you would like to find information about.',
required: false
diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts
index 3038658..6584ab5 100644
--- a/src/commands/info/ping.ts
+++ b/src/commands/info/ping.ts
@@ -1,6 +1,6 @@
import { Message, MessageEmbed } from 'discord.js';
import { BushCommand } from '../../lib/extensions/BushCommand';
-import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
export default class PingCommand extends BushCommand {
constructor() {
diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts
index 2175233..107af82 100644
--- a/src/commands/info/pronouns.ts
+++ b/src/commands/info/pronouns.ts
@@ -1,6 +1,8 @@
-import { CommandInteraction, Message, MessageEmbed, User } from 'discord.js';
+import { ApplicationCommandOptionType } from 'discord-api-types';
+import { Message, MessageEmbed, User } from 'discord.js';
import got, { HTTPError } from 'got';
import { BushCommand } from '../../lib/extensions/BushCommand';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
export const pronounMapping = {
unspecified: 'Unspecified',
@@ -41,13 +43,17 @@ export default class PronounsCommand extends BushCommand {
{
id: 'user',
type: 'user',
- default: null
+ prompt: {
+ start: 'Who would you like to view the pronouns of?',
+ retry: '{error} Choose a valid user to view the pronouns of.',
+ optional: true
+ }
}
],
clientPermissions: ['SEND_MESSAGES'],
slashOptions: [
{
- type: 'USER',
+ type: ApplicationCommandOptionType.USER,
name: 'user',
description: 'The user to get pronouns for',
required: false
@@ -56,52 +62,36 @@ export default class PronounsCommand extends BushCommand {
slash: true
});
}
- async sendResponse(message: Message | CommandInteraction, user: User, author: boolean): Promise<void> {
+ async exec(message: Message | BushSlashMessage, args: { user?: User }): Promise<void> {
+ const user = args.user || message.author;
+ const author = user.id === message.author.id;
try {
const apiRes: { pronouns: pronounsType } = await got
.get(`https://pronoundb.org/api/v1/lookup?platform=discord&id=${user.id}`)
.json();
- if (message instanceof Message) {
- message.reply({
- embeds: [
- new MessageEmbed({
- title: `${author ? 'Your' : `${user.tag}'s`} pronouns:`,
- description: pronounMapping[apiRes.pronouns],
- footer: {
- text: 'Data provided by https://pronoundb.org/'
- }
- })
- ]
- });
- } else {
- message.reply({
- embeds: [
- new MessageEmbed({
- title: `${author ? 'Your' : `${user.tag}'s`} pronouns:`,
- description: pronounMapping[apiRes.pronouns],
- footer: {
- text: 'Data provided by https://pronoundb.org/'
- }
- })
- ]
- });
- }
+ message.util.reply({
+ embeds: [
+ new MessageEmbed({
+ title: `${author ? 'Your' : `${user.tag}'s`} pronouns:`,
+ description: pronounMapping[apiRes.pronouns],
+ footer: {
+ text: 'Data provided by https://pronoundb.org/'
+ }
+ })
+ ]
+ });
} catch (e) {
if (e instanceof HTTPError && e.response.statusCode === 404) {
if (author) {
- await message.reply(
+ await message.util.reply(
'You do not appear to have any pronouns set. Please go to https://pronoundb.org/ and set your pronouns.'
);
} else {
- await message.reply(
+ await message.util.reply(
`${user.tag} does not appear to have any pronouns set. Please tell them to go to https://pronoundb.org/ and set their pronouns.`
);
}
} else throw e;
}
}
- async exec(message: Message, { user }: { user?: User }): Promise<void> {
- const u = user || message.author;
- await this.sendResponse(message, u, u.id === message.author.id);
- }
}
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts
index 7ce222a..9d7eb4d 100644
--- a/src/commands/moderation/ban.ts
+++ b/src/commands/moderation/ban.ts
@@ -1,4 +1,5 @@
import { Argument } from 'discord-akairo';
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { CommandInteraction, Message, User } from 'discord.js';
import moment from 'moment';
import { BushCommand } from '../../lib/extensions/BushCommand';
@@ -52,19 +53,19 @@ export default class BanCommand extends BushCommand {
},
slashOptions: [
{
- type: 'USER',
+ type: ApplicationCommandOptionType.USER,
name: 'user',
description: 'Who would you like to ban?',
required: true
},
{
- type: 'STRING',
+ type: ApplicationCommandOptionType.STRING,
name: 'reason',
description: 'Why are they getting banned?',
required: false
},
{
- type: 'STRING',
+ type: ApplicationCommandOptionType.STRING,
name: 'time',
description: 'How long should they be banned for?',
required: false
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts
index eed3038..d7fdfbd 100644
--- a/src/commands/moderation/kick.ts
+++ b/src/commands/moderation/kick.ts
@@ -1,6 +1,7 @@
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { CommandInteraction, GuildMember, Message } from 'discord.js';
import { BushCommand } from '../../lib/extensions/BushCommand';
-import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
import { Guild, ModLog, ModLogType } from '../../lib/models';
export default class KickCommand extends BushCommand {
@@ -32,13 +33,13 @@ export default class KickCommand extends BushCommand {
},
slashOptions: [
{
- type: 'USER',
+ type: ApplicationCommandOptionType.USER,
name: 'user',
description: 'The user to kick',
required: true
},
{
- type: 'STRING',
+ type: ApplicationCommandOptionType.STRING,
name: 'reason',
description: 'The reason to show in modlogs and audit log',
required: false
diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts
index 9b6ad70..eeb2d04 100644
--- a/src/commands/moderation/mute.ts
+++ b/src/commands/moderation/mute.ts
@@ -1,4 +1,5 @@
import { Argument } from 'discord-akairo';
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { CommandInteraction, Message, User } from 'discord.js';
import moment from 'moment';
import { BushCommand } from '../../lib/extensions/BushCommand';
@@ -43,19 +44,19 @@ export default class MuteCommand extends BushCommand {
},
slashOptions: [
{
- type: 'USER',
+ type: ApplicationCommandOptionType.USER,
name: 'user',
description: 'The user to mute.',
required: true
},
{
- type: 'STRING',
+ type: ApplicationCommandOptionType.STRING,
name: 'reason',
description: 'Why the user is getting muted.',
required: false
},
{
- type: 'STRING',
+ type: ApplicationCommandOptionType.STRING,
name: 'time',
description: 'How long the user should be muted for.',
required: false
diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts
index f0918f0..4eb745d 100644
--- a/src/commands/moderation/role.ts
+++ b/src/commands/moderation/role.ts
@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-empty-function */
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { GuildMember, Message, Role } from 'discord.js';
import { BushCommand } from '../../lib/extensions/BushCommand';
import AllowedMentions from '../../lib/utils/AllowedMentions';
@@ -57,13 +58,13 @@ export default class RoleCommand extends BushCommand {
],
slashOptions: [
{
- type: 'USER',
+ type: ApplicationCommandOptionType.USER,
name: 'user',
description: 'The user to add/remove the role on',
required: true
},
{
- type: 'ROLE',
+ type: ApplicationCommandOptionType.ROLE,
name: 'role',
description: 'The role to add/remove',
required: true
diff --git a/src/commands/moulberry-bush/capePerms.ts b/src/commands/moulberry-bush/capePerms.ts
index d1850c8..49e591a 100644
--- a/src/commands/moulberry-bush/capePerms.ts
+++ b/src/commands/moulberry-bush/capePerms.ts
@@ -1,4 +1,5 @@
import { Constants } from 'discord-akairo';
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { MessageEmbed } from 'discord.js';
import got from 'got';
import { BushCommand } from '../../lib/extensions/BushCommand';
@@ -61,7 +62,7 @@ export default class CapePermissionsCommand extends BushCommand {
{
name: 'ign',
description: 'The ign of the player you would like to view the capes permissions of.',
- type: 'STRING',
+ type: ApplicationCommandOptionType.STRING,
required: true
}
]
diff --git a/src/commands/moulberry-bush/level.ts b/src/commands/moulberry-bush/level.ts
index 41541e0..ea51f94 100644
--- a/src/commands/moulberry-bush/level.ts
+++ b/src/commands/moulberry-bush/level.ts
@@ -1,6 +1,7 @@
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { Message, User } from 'discord.js';
import { BushCommand } from '../../lib/extensions/BushCommand';
-import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage';
+import { BushSlashMessage } from '../../lib/extensions/BushSlashMessage';
import { Level } from '../../lib/models';
/*
import canvas from 'canvas';
@@ -33,7 +34,7 @@ export default class LevelCommand extends BushCommand {
],
slashOptions: [
{
- type: 'USER',
+ type: ApplicationCommandOptionType.USER,
name: 'user',
description: 'The user to get the level of',
required: false
diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts
index 3cd9ec6..8aec247 100644
--- a/src/commands/moulberry-bush/rule.ts
+++ b/src/commands/moulberry-bush/rule.ts
@@ -1,4 +1,5 @@
import { Argument, Constants } from 'discord-akairo';
+import { ApplicationCommandOptionType } from 'discord-api-types';
import { MessageEmbed, User } from 'discord.js';
import { BushCommand } from '../../lib/extensions/BushCommand';
import { BushMessage } from '../../lib/extensions/BushMessage';
@@ -94,13 +95,13 @@ export default class RuleCommand extends BushCommand {
{
name: 'rule',
description: 'The rule you would you like to have cited',
- type: 'INTEGER',
+ type: ApplicationCommandOptionType.INTEGER,
required: false
},
{
name: 'user',
description: 'The user you would like to mention.',
- type: 'USER',
+ type: ApplicationCommandOptionType.USER,
required: false
}
],