From 85a535956f5b6fbb035dca090123ece7fa8be8b5 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 6 Dec 2022 20:22:27 -0500 Subject: Used ChatGPT to fix certain problems; Removed more unnessesary stuff --- backend/AudioControl.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'backend/AudioControl.js') diff --git a/backend/AudioControl.js b/backend/AudioControl.js index 2b314d2..447e040 100644 --- a/backend/AudioControl.js +++ b/backend/AudioControl.js @@ -22,7 +22,6 @@ import { readdirSync, readFileSync } from 'node:fs'; import { shufflePlaylist, orderPlaylist } from './QueueSystem.js'; import { playAudio, currentTrack, updatePlaylist } from './PlayAudio.js'; import { player } from './VoiceInitialization.js'; -import { destroyAudio } from './Shutdown.js'; const { shuffle, repeat } = JSON.parse(readFileSync('./config.json', 'utf-8')); export const files = readdirSync('music'); @@ -44,8 +43,7 @@ async function repeatCheck(bot) { } export async function nextAudio(bot) { - totalTrack--; - if (currentTrack >= totalTrack) { + if (currentTrack >= totalTrack - 1) { await repeatCheck(bot); } else { updatePlaylist('next'); @@ -54,7 +52,6 @@ export async function nextAudio(bot) { } export async function previousAudio(bot, interaction) { - totalTrack++; if (currentTrack <= 0) { return await interaction.reply({ content: 'You are at the beginning of the playlist, cannot go further than this', ephemeral: true }); } else { -- cgit v1.2.3