aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-12-06 20:22:27 -0500
committerAndrew Lee <alee14498@protonmail.com>2022-12-06 20:22:27 -0500
commit85a535956f5b6fbb035dca090123ece7fa8be8b5 (patch)
tree27d12f147be55c3741a130208799bb9442a4753c
parentf91f277a30a081cde95805bf39adeb835be98c3f (diff)
downloadDLAP-85a535956f5b6fbb035dca090123ece7fa8be8b5.tar.gz
DLAP-85a535956f5b6fbb035dca090123ece7fa8be8b5.tar.bz2
DLAP-85a535956f5b6fbb035dca090123ece7fa8be8b5.zip
Used ChatGPT to fix certain problems; Removed more unnessesary stuff
-rw-r--r--README.md2
-rw-r--r--backend/AudioControl.js5
-rw-r--r--backend/PlayAudio.js2
-rw-r--r--backend/Shutdown.js2
-rw-r--r--bot.js1
5 files changed, 4 insertions, 8 deletions
diff --git a/README.md b/README.md
index 4dcd8aa..d4356f5 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# DLAP Bot (Discord.JS Local Audio Player)
-A Discord bot that plays local audio tracks. Written in Discord.JS v14.
+DLAP is a Discord bot that lets you play local audio tracks in your server. With DLAP, you can access your music files, and share your tunes with your friends and community. DLAP offers seamless integration with Discord, so you can enjoy your music without missing a beat.
[Video Tutorial](https://youtu.be/Gvva8LHjOOo) |
[Support Server](https://discord.gg/EFhRDqG)
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 {
diff --git a/backend/PlayAudio.js b/backend/PlayAudio.js
index d698798..fea4b3d 100644
--- a/backend/PlayAudio.js
+++ b/backend/PlayAudio.js
@@ -62,7 +62,7 @@ export async function playAudio(bot) {
} else {
metadataEmpty = true;
}
- duration = new Date(format.duration * 1000).toISOString().substr(11, 8);
+ duration = new Date(format.duration * 1000).toISOString().slice(11, 19);
} catch (e) {
console.error(e);
}
diff --git a/backend/Shutdown.js b/backend/Shutdown.js
index e1c1d26..fb89505 100644
--- a/backend/Shutdown.js
+++ b/backend/Shutdown.js
@@ -55,6 +55,6 @@ export async function stopBot(bot, interaction) {
console.log(`Powering off ${bot.user.username}...`);
await destroyAudio(interaction);
- bot.destroy();
+ await bot.destroy();
return process.exit(0);
}
diff --git a/bot.js b/bot.js
index ef01d55..9944f24 100644
--- a/bot.js
+++ b/bot.js
@@ -28,7 +28,6 @@ bot.login(token);
/**
* TODO: - Custom string support (Basically change what the bot is saying)
- * - Non repeat support
* - Easier to use interface
*/