diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-05-26 21:53:35 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-05-26 21:53:35 -0400 |
commit | cd0f853a2e4732cea5356f9ee3603bb804b0ab1f (patch) | |
tree | ac2f6ced46dfae7ca376e4dbd957d99a341d86a9 /src/commands/moulberry-bush/level.ts | |
parent | 0caccda67d97dd74405aa4ece5d3f07e7c7dfc66 (diff) | |
download | tanzanite-cd0f853a2e4732cea5356f9ee3603bb804b0ab1f.tar.gz tanzanite-cd0f853a2e4732cea5356f9ee3603bb804b0ab1f.tar.bz2 tanzanite-cd0f853a2e4732cea5356f9ee3603bb804b0ab1f.zip |
made some more changes
Diffstat (limited to 'src/commands/moulberry-bush/level.ts')
-rw-r--r-- | src/commands/moulberry-bush/level.ts | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/commands/moulberry-bush/level.ts b/src/commands/moulberry-bush/level.ts deleted file mode 100644 index decac8a..0000000 --- a/src/commands/moulberry-bush/level.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { ApplicationCommandOptionType } from 'discord-api-types'; -import { Message } from 'discord.js'; -import { CommandInteractionOption } from 'discord.js'; -import { CommandInteraction } from 'discord.js'; -import { User } from 'discord.js'; -import { BushCommand } from '../../lib/extensions/BushCommand'; -import { Level } from '../../lib/models'; - -export default class LevelCommand extends BushCommand { - constructor() { - super('level', { - aliases: ['level', 'rank'], - category: "Moulberry's Bush", - description: { - content: 'Shows the level of a user', - usage: 'level [user]', - examples: ['level', 'level @Tyman'] - }, - args: [ - { - id: 'user', - type: 'user', - prompt: { - start: 'What user would you like to see the level of?', - retry: - 'Invalid user. What user would you like to see the level of?', - optional: true - } - } - ], - slashCommandOptions: [ - { - type: ApplicationCommandOptionType.USER, - name: 'user', - description: 'The user to get the level of', - required: false - } - ] - }); - } - - private async getResponse(user: User): Promise<string> { - const userLevelRow = await Level.findByPk(user.id); - if (userLevelRow) { - return `${user ? `${user.tag}'s` : 'Your'} level is ${ - userLevelRow.level - } (${userLevelRow.xp} XP)`; - } else { - return `${user ? `${user.tag} does` : 'You do'} not have a level yet!`; - } - } - - async exec(message: Message, { user }: { user?: User }): Promise<void> { - await message.reply(await this.getResponse(user || message.author)); - } - async execSlash( - message: CommandInteraction, - { user }: { user?: CommandInteractionOption } - ): Promise<void> { - await message.reply(await this.getResponse(user?.user || message.user)); - } -} |