From 1e294d91c3eab7e65936010c8f0c81c4c4f73b96 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 5 Jul 2022 23:08:59 -0400 Subject: Removed help; Updated all the new commands; Finally removed final control panel code --- commands/play.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'commands/play.js') diff --git a/commands/play.js b/commands/play.js index a6d3453..2a5a385 100644 --- a/commands/play.js +++ b/commands/play.js @@ -20,7 +20,7 @@ ***************************************************************************/ import { SlashCommandBuilder } from '@discordjs/builders' -import { inputAudio, audio } from '../AudioBackend.js' +import { isAudioStatePaused, inputAudio, audio, audioState, player } from '../AudioBackend.js' import config from '../config.json' assert {type: 'json'} export let integer; @@ -33,10 +33,19 @@ export default { option.setName('int') .setDescription('Input a number for the selection for the audio file.'), ), + async execute(interaction, bot) { - if (![config.botOwner].includes(interaction.user.id)) return await interaction.reply({ content: "You do not have permissions to execute this command.", ephemeral: true }); integer = interaction.options.getInteger('int'); - await inputAudio(bot, integer); - return await interaction.reply({ content: `Now playing: ${audio}`, ephemeral: true }); + if (integer) { + await inputAudio(bot, integer); + return await interaction.reply({ content: `Now playing: ${audio}`, ephemeral: true }); + } + if (isAudioStatePaused === true) { + audioState(); + player.unpause(); + return await interaction.reply({content:'Resuming music', ephemeral:true}); + } else { + return await interaction.reply({content:"Music is already playing", ephemeral:true}) + } }, }; \ No newline at end of file -- cgit v1.2.3