diff options
| author | Max Isom <[email protected]> | 2022-01-19 13:46:32 -0600 |
|---|---|---|
| committer | Max Isom <[email protected]> | 2022-01-19 13:46:32 -0600 |
| commit | 4169104c4df909c9c700ca0481dddd74d86169ec (patch) | |
| tree | bc2b7c3c2a9f708a166f437a092e18fe3ebbafff /src/commands/skip.ts | |
| parent | ed4e7b5ceb146a9baa062426cc0fb1ec8844e056 (diff) | |
| download | muse-4169104c4df909c9c700ca0481dddd74d86169ec.tar.xz muse-4169104c4df909c9c700ca0481dddd74d86169ec.zip | |
Type fixes, remove shortcuts
Diffstat (limited to 'src/commands/skip.ts')
| -rw-r--r-- | src/commands/skip.ts | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/src/commands/skip.ts b/src/commands/skip.ts index 93b8bc3..f8900da 100644 --- a/src/commands/skip.ts +++ b/src/commands/skip.ts @@ -1,9 +1,8 @@ -import {CommandInteraction, Message, TextChannel} from 'discord.js'; +import {CommandInteraction} from 'discord.js'; import {TYPES} from '../types.js'; import {inject, injectable} from 'inversify'; import PlayerManager from '../managers/player.js'; import Command from '.'; -import LoadingMessage from '../utils/loading-message.js'; import errorMsg from '../utils/error-msg.js'; import {SlashCommandBuilder} from '@discordjs/builders'; @@ -32,7 +31,7 @@ export default class implements Command { this.playerManager = playerManager; } - public async executeFromInteraction(interaction: CommandInteraction): Promise<void> { + public async execute(interaction: CommandInteraction): Promise<void> { const numToSkip = interaction.options.getInteger('skip') ?? 1; if (numToSkip < 1) { @@ -48,27 +47,4 @@ export default class implements Command { await interaction.reply({content: errorMsg('invalid number of songs to skip'), ephemeral: true}); } } - - public async execute(msg: Message, args: string []): Promise<void> { - let numToSkip = 1; - - if (args.length === 1) { - if (!Number.isNaN(parseInt(args[0], 10))) { - numToSkip = parseInt(args[0], 10); - } - } - - const player = this.playerManager.get(msg.guild!.id); - - const loader = new LoadingMessage(msg.channel as TextChannel); - - try { - await loader.start(); - await player.forward(numToSkip); - - await loader.stop('keep \'er movin\''); - } catch (_: unknown) { - await loader.stop(errorMsg('no song to skip to')); - } - } } |
