mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-27 17:22:42 +02:00
Throw errors in command handlers
This commit is contained in:
parent
aacb107f43
commit
2e5e509b32
11 changed files with 18 additions and 100 deletions
|
@ -2,7 +2,6 @@ import {CommandInteraction} from 'discord.js';
|
|||
import {TYPES} from '../types.js';
|
||||
import {inject, injectable} from 'inversify';
|
||||
import PlayerManager from '../managers/player.js';
|
||||
import errorMsg from '../utils/error-msg.js';
|
||||
import Command from '.';
|
||||
import {SlashCommandBuilder} from '@discordjs/builders';
|
||||
|
||||
|
@ -24,11 +23,7 @@ export default class implements Command {
|
|||
const player = this.playerManager.get(interaction.guild!.id);
|
||||
|
||||
if (player.isQueueEmpty()) {
|
||||
await interaction.reply({
|
||||
content: errorMsg('not enough songs to shuffle'),
|
||||
ephemeral: true,
|
||||
});
|
||||
return;
|
||||
throw new Error('not enough songs to shuffle');
|
||||
}
|
||||
|
||||
player.shuffle();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue