diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-05-26 21:36:50 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-05-26 21:36:50 -0400 |
commit | 0caccda67d97dd74405aa4ece5d3f07e7c7dfc66 (patch) | |
tree | ac124c6c059d96f33fdd3bf1cfec282d8792f16b /src/commands/admin | |
parent | 481a157a177e60f023b59e4e9acffc549760db40 (diff) | |
download | tanzanite-0caccda67d97dd74405aa4ece5d3f07e7c7dfc66.tar.gz tanzanite-0caccda67d97dd74405aa4ece5d3f07e7c7dfc66.tar.bz2 tanzanite-0caccda67d97dd74405aa4ece5d3f07e7c7dfc66.zip |
some rebranding
Diffstat (limited to 'src/commands/admin')
-rw-r--r-- | src/commands/admin/prefix.ts | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/src/commands/admin/prefix.ts b/src/commands/admin/prefix.ts deleted file mode 100644 index 112f6b8..0000000 --- a/src/commands/admin/prefix.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { ApplicationCommandOptionType } from 'discord-api-types'; -import { CommandInteraction, Message, Guild as DiscordGuild } from 'discord.js'; -import { BotCommand } from '../../lib/extensions/BotCommand'; -import { SlashCommandOption } from '../../lib/extensions/Util'; -import { Guild } from '../../lib/models'; - -export default class PrefixCommand extends BotCommand { - constructor() { - super('prefix', { - aliases: ['prefix'], - args: [ - { - id: 'prefix' - } - ], - userPermissions: ['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 +'] - }, - slashCommandOptions: [ - { - type: ApplicationCommandOptionType.STRING, - name: 'prefix', - description: 'The prefix to set for this server', - required: false - } - ] - }); - } - - async changePrefix(guild: DiscordGuild, prefix?: string): Promise<void> { - if (prefix) { - const row = await Guild.findByPk(guild.id); - row.prefix = prefix; - await row.save(); - } else { - const row = await Guild.findByPk(guild.id); - row.prefix = this.client.config.prefix; - await row.save(); - } - } - - async exec(message: Message, { prefix }: { prefix?: string }): Promise<void> { - await this.changePrefix(message.guild, prefix); - if (prefix) { - await message.util.send(`Sucessfully set prefix to \`${prefix}\``); - } else { - await message.util.send( - `Sucessfully reset prefix to \`${this.client.config.prefix}\`` - ); - } - } - - async execSlash( - message: CommandInteraction, - { prefix }: { prefix?: SlashCommandOption<string> } - ): Promise<void> { - await this.changePrefix(message.guild, prefix?.value); - if (prefix) { - await message.reply(`Sucessfully set prefix to \`${prefix.value}\``); - } else { - await message.reply( - `Sucessfully reset prefix to \`${this.client.config.prefix}\`` - ); - } - } -} |