diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2024-02-15 17:18:15 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2024-02-15 17:20:59 -0500 |
| commit | d98937b34bbb7582f4c13e0d18bcc30febe1d174 (patch) | |
| tree | 04133cf911474c50674084b58a65361bf8990a35 /Commands/play.js | |
| parent | 16b7fb29fb5bd01f346749020dc43fa24a16993f (diff) | |
| download | DLAP-d98937b34bbb7582f4c13e0d18bcc30febe1d174.tar.gz DLAP-d98937b34bbb7582f4c13e0d18bcc30febe1d174.tar.bz2 DLAP-d98937b34bbb7582f4c13e0d18bcc30febe1d174.zip | |
Finally fixed some issues
- Voting should work properly?
- Now the bot tells the user if they are already in vc
- Thumbnails will be null when switching tracks
Diffstat (limited to 'Commands/play.js')
| -rw-r--r-- | Commands/play.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Commands/play.js b/Commands/play.js index 7cfe36b..d514cfe 100644 --- a/Commands/play.js +++ b/Commands/play.js @@ -21,7 +21,7 @@ import { SlashCommandBuilder } from 'discord.js'; import { inputAudio } from '../AudioBackend/QueueSystem.js'; -import { files, isAudioStatePaused, toggleAudioState } from '../AudioBackend/AudioControl.js'; +import { files, isAudioStatePaused, playerStatus, toggleAudioState } from '../AudioBackend/AudioControl.js'; import { audio } from '../AudioBackend/PlayAudio.js'; import { PermissionFlagsBits } from 'discord-api-types/v10'; import { readFileSync } from 'node:fs'; @@ -51,16 +51,20 @@ export default { if (integer < files.length) { await inputAudio(bot, integer); await votes.clear(); - return await interaction.reply({ content: t('nowPlayingFile', audio), ephemeral: true }); + return await interaction.reply({ content: t('nowPlayingFile', { audio }), ephemeral: true }); } else { return await interaction.reply({ content: t('numBig', { files: files.length }), ephemeral: true }); } } - if (isAudioStatePaused) { - toggleAudioState(); - return await interaction.reply({ content: t('resumingMusic'), ephemeral: true }); + if (playerStatus === 2) { + return await interaction.reply({ content: t('statusStopped'), ephemeral: true }); } else { - return await interaction.reply({ content: t('resumedAlready'), ephemeral: true }); + if (isAudioStatePaused) { + toggleAudioState(); + return await interaction.reply({ content: t('resumingMusic'), ephemeral: true }); + } else { + return await interaction.reply({ content: t('resumedAlready'), ephemeral: true }); + } } } }; |
