diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | backend/AudioControl.js | 5 | ||||
| -rw-r--r-- | backend/PlayAudio.js | 2 | ||||
| -rw-r--r-- | backend/Shutdown.js | 2 | ||||
| -rw-r--r-- | bot.js | 1 |
5 files changed, 4 insertions, 8 deletions
@@ -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); } @@ -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 */ |
