Skip to content

Commit

Permalink
music player now working!
Browse files Browse the repository at this point in the history
  • Loading branch information
Niceygy committed Oct 28, 2023
1 parent 5add43c commit bdd5314
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
7 changes: 5 additions & 2 deletions commands/music-play.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {
Client,
ChatInputCommandInteraction,
} = require("discord.js");
const { useMasterPlayer } = require("discord-player");
const { useMasterPlayer, Player } = require("discord-player");

module.exports = {
data: new SlashCommandBuilder()
Expand All @@ -26,8 +26,11 @@ module.exports = {
console.log("Starting music player...")
// return await interaction.reply("This command is currently disabled.");
await interaction.deferReply();
const player = useMasterPlayer();
//const player = useMasterPlayer();
const player = new Player(client)
await player.extractors.loadDefault();
const songName = interaction.options.getString("song-name", true);
console.log

if (!interaction.member.voice.channelId) {
return await interaction.editReply({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
"spotify-url-info": "^3.2.3",
"txtgen": "^3.0.2",
"youtube-sr": "^4.3.4",
"ytdl-core": "4.x"
"ytdl-core": "^4.11.5"
}
}
15 changes: 10 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3286,11 +3286,16 @@ saslprep@^1.0.3:
dependencies:
sparse-bitfield "^3.0.3"

sax@>=0.6.0, sax@^1.1.3, sax@^1.2.4:
sax@>=0.6.0, sax@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==

sax@^1.1.3:
version "1.3.0"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.3.0.tgz#a5dbe77db3be05c9d1ee7785dbd3ea9de51593d0"
integrity sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==

semver@^6.0.0:
version "6.3.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
Expand Down Expand Up @@ -3829,10 +3834,10 @@ youtube-sr@^4.3.4:
resolved "https://registry.yarnpkg.com/youtube-sr/-/youtube-sr-4.3.4.tgz#cbd2d446de2b0c43f5dd3ea5333222a327eddaf0"
integrity sha512-olSYcR80XigutCrePEXBX3/RJJrWfonJQj7+/ggBiWU0CzTDLE1q8+lpWTWCG0JpzhzILp/IB/Bq/glGqqr1TQ==

ytdl-core@4.x:
version "4.11.4"
resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-4.11.4.tgz#0ee2bd04d8effa7b8762a3ba0e3d038e37dc10f2"
integrity sha512-tsVvqt++B5LSTMnCKQb4H/PFBewKj7gGPJ6KIM5gOFGMKNZj4qglGAl4QGFG8cNPP6wY54P80FDID5eN2di0GQ==
ytdl-core@^4.11.5:
version "4.11.5"
resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-4.11.5.tgz#8cc3dc9e4884e24e8251250cfb56313a300811f0"
integrity sha512-27LwsW4n4nyNviRCO1hmr8Wr5J1wLLMawHCQvH8Fk0hiRqrxuIu028WzbJetiYH28K8XDbeinYW4/wcHQD1EXA==
dependencies:
m3u8stream "^0.8.6"
miniget "^4.2.2"
Expand Down

0 comments on commit bdd5314

Please sign in to comment.