From d98937b34bbb7582f4c13e0d18bcc30febe1d174 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 15 Feb 2024 17:18:15 -0500 Subject: 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 --- Commands/play.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Commands/play.js') 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 }); + } } } }; -- cgit v1.2.3