diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2022-07-07 23:49:37 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2022-07-07 23:49:37 -0400 |
| commit | 83e4c8679c656ecb352ddc34d5dced9518ba240a (patch) | |
| tree | 0f220abe0de074880e5f28d4e0779dc6b98d7c07 /commands/play.js | |
| parent | 8d2042206df47b0f172ecc829b5f2c518b89a6a5 (diff) | |
| download | DLAP-83e4c8679c656ecb352ddc34d5dced9518ba240a.tar.gz DLAP-83e4c8679c656ecb352ddc34d5dced9518ba240a.tar.bz2 DLAP-83e4c8679c656ecb352ddc34d5dced9518ba240a.zip | |
New shuffling system (not bug free yet); Tweaks and fixes on other commands
Diffstat (limited to 'commands/play.js')
| -rw-r--r-- | commands/play.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/commands/play.js b/commands/play.js index 2785288..d206c56 100644 --- a/commands/play.js +++ b/commands/play.js @@ -20,7 +20,7 @@ ***************************************************************************/ import { SlashCommandBuilder } from '@discordjs/builders' -import { isAudioStatePaused, inputAudio, audio, audioState, player } from '../AudioBackend.js' +import { isAudioStatePaused, inputAudio, audio, audioState, player, files } from '../AudioBackend.js' import { PermissionFlagsBits } from "discord-api-types/v10" export let integer; @@ -38,8 +38,12 @@ export default { async execute(interaction, bot) { integer = interaction.options.getInteger('int'); if (integer) { - await inputAudio(bot, integer); - return await interaction.reply({ content: `Now playing: ${audio}`, ephemeral: true }); + if (integer < files.length) { + await inputAudio(bot, integer); + return await interaction.reply({content:`Now playing: ${audio}`, ephemeral:true}); + } else { + return await interaction.reply({content:'Number is too big, choose a number that\'s less than ' + files.length + '.', ephemeral:true}) + } } if (isAudioStatePaused === true) { audioState(); |
