Skip to content

Commit

Permalink
Fixed the music...
Browse files Browse the repository at this point in the history
  • Loading branch information
Prince527GitHub committed Mar 10, 2024
1 parent 4f61c1e commit 20c830a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 12 deletions.
5 changes: 3 additions & 2 deletions SlashCommands/music/play.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { EmbedBuilder, ApplicationCommandType, ApplicationCommandOptionType } = require("discord.js");
const musicSchema = require("../../models/server/music.js");

module.exports = {
name: "play",
Expand Down Expand Up @@ -56,7 +57,7 @@ module.exports = {
const resolve = await client.poru.resolve({ query: songTitle, source: "ytsearch" });
const { loadType, tracks, playlistInfo } = resolve;

if (loadType === "PLAYLIST_LOADED") {
if (loadType === "playlist") {

for (const track of resolve.tracks) {
track.info.requester = interaction.member;
Expand All @@ -72,7 +73,7 @@ module.exports = {
]
});

} else if (loadType === "SEARCH_RESULT" || loadType === "TRACK_LOADED") {
} else if (loadType === "track") {

const track = tracks.shift();
track.info.requester = interaction.member;
Expand Down
Binary file modified lavalink/app/Lavalink.jar
Binary file not shown.
40 changes: 34 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"mongoose": "^8.1.1",
"passport": "^0.7.0",
"passport-discord": "^0.1.4",
"poru": "^4.2.1",
"poru": "^5.1.0",
"table": "6.8.1",
"tinyld": "^1.3.4",
"typescript": "4.9.4",
Expand Down
6 changes: 3 additions & 3 deletions website/router/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ router.post("/music/play", checkAPIAuth, async (req, res) => {

const { loadType, tracks, playlistInfo } = await client.poru.resolve({ query: query, source: "ytsearch" });

const api = { type: loadType === "PLAYLIST_LOADED" ? "playlist" : "search" };
const api = { type: loadType === "playlist" ? "playlist" : "search" };

if (loadType === "PLAYLIST_LOADED") {
if (loadType === "playlist") {
for (const track of tracks) {
track.info.requester = member;
player.queue.add(track);
Expand All @@ -53,7 +53,7 @@ router.post("/music/play", checkAPIAuth, async (req, res) => {
length: tracks.length,
title: playlistInfo.name
};
} else if (loadType === "SEARCH_RESULT" || loadType === "TRACK_LOADED") {
} else if (loadType === "track") {
const track = tracks.shift();
track.info.requester = member;
player.queue.add(track);
Expand Down

0 comments on commit 20c830a

Please sign in to comment.