mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
Merge pull request #375 from pryzmian/main
chore: update volume command options
This commit is contained in:
1 file changed
-25
@@ -35,8 +35,6 @@ class VolumeCommand extends BaseSlashCommandInteraction {
|
|||||||
|
|
||||||
if (!volume && volume !== 0) {
|
if (!volume && volume !== 0) {
|
||||||
return await this.handleShowCurrentVolume(queue, logger, interaction, translator);
|
return await this.handleShowCurrentVolume(queue, logger, interaction, translator);
|
||||||
} else if (volume > 100 || volume < 0) {
|
|
||||||
return await this.handleInvalidVolumeInput(volume, logger, interaction, translator);
|
|
||||||
} else {
|
} else {
|
||||||
return await this.handleValidVolumeInput(volume, queue, logger, interaction, translator);
|
return await this.handleValidVolumeInput(volume, queue, logger, interaction, translator);
|
||||||
}
|
}
|
||||||
@@ -69,29 +67,6 @@ class VolumeCommand extends BaseSlashCommandInteraction {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async handleInvalidVolumeInput(
|
|
||||||
volume: number,
|
|
||||||
logger: Logger,
|
|
||||||
interaction: ChatInputCommandInteraction,
|
|
||||||
translator: TFunction
|
|
||||||
) {
|
|
||||||
logger.debug('Volume specified was higher than 100% or lower than 0%.');
|
|
||||||
|
|
||||||
logger.debug('Responding with warning embed.');
|
|
||||||
return await interaction.editReply({
|
|
||||||
embeds: [
|
|
||||||
new EmbedBuilder()
|
|
||||||
.setDescription(
|
|
||||||
translator('commands.volume.invalidVolumeRange', {
|
|
||||||
icon: this.embedOptions.icons.warning,
|
|
||||||
wrongVolume: volume
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.setColor(this.embedOptions.colors.warning)
|
|
||||||
]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private async handleValidVolumeInput(
|
private async handleValidVolumeInput(
|
||||||
volume: number,
|
volume: number,
|
||||||
queue: GuildQueue,
|
queue: GuildQueue,
|
||||||
|
|||||||
Reference in new issue
Block a user