lavaclient / plugins

Official plugins for lavaclient
https://lavaclient.js.org
MIT License
8 stars 5 forks source link

Spotify song not playing and not supported by queue #2

Closed samchouse closed 3 years ago

samchouse commented 3 years ago

When trying to play the bot doesn't make any sounds

    if (this.client.manager.spotify.isSpotifyUrl(query)) {
      const item = await this.client.manager.spotify.load(query);
      if (item instanceof SpotifyTrack) {
        if (!player.connected)
          message.guild!.player!.connect(message.member!.voice.channel.id, {
            selfDeaf: true
          });

        player.setVolume(100);

        return player.play(item);
      }
    }

When using in queue I get this error

?play https://open.spotify.com/track/6wQlQrTY5mVS8EGaFZVwVF?si=24fdb4c246a145fb | Cannot read property 'buffer' of undefined
TypeError: Cannot read property 'buffer' of undefined
    at new DataInput (/home/xenfo/Desktop/Projects/discord-bots/muz/node_modules/.pnpm/@lavalink+encoding@0.1.1/node_modules/@lavalink/encoding/dist/src/DataInput.js:11:40)
    at Object.decode (/home/xenfo/Desktop/Projects/discord-bots/muz/node_modules/.pnpm/@lavalink+encoding@0.1.1/node_modules/@lavalink/encoding/dist/src/index.js:110:19)
    at new Song (/home/xenfo/Desktop/Projects/discord-bots/muz/node_modules/.pnpm/@lavaclient+queue@1.0.3/node_modules/@lavaclient/queue/dist/Song.js:9:36)
    at Queue.add (/home/xenfo/Desktop/Projects/discord-bots/muz/node_modules/.pnpm/@lavaclient+queue@1.0.3/node_modules/@lavaclient/queue/dist/Queue.js:66:25)
    at PlayCommand.exec (/home/xenfo/Desktop/Projects/discord-bots/muz/dist/src/bot/commands/music/Play.js:53:37)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async CommandHandler.runCommand (/home/xenfo/Desktop/Projects/discord-bots/muz/node_modules/.pnpm/discord-akairo@8.1.0/node_modules/discord-akairo/src/struct/commands/CommandHandler.js:768:25)
    at async CommandHandler.handleDirectCommand (/home/xenfo/Desktop/Projects/discord-bots/muz/node_modules/.pnpm/discord-akairo@8.1.0/node_modules/discord-akairo/src/struct/commands/CommandHandler.js:439:20)
    at async CommandHandler.handle (/home/xenfo/Desktop/Projects/discord-bots/muz/node_modules/.pnpm/discord-akairo@8.1.0/node_modules/discord-akairo/src/struct/commands/CommandHandler.js:379:23)
birongliu commented 3 years ago

There are a method in Spotify Manager call isSpotifyUrl to check if it a spotify url if so you can resolve the track. And it good idea to join lavaclient support server 😀

samchouse commented 3 years ago

I am checking if it's a Spotify URL and I'll be joining the support server shortly!

Edit: the support server's link is expired.

samchouse commented 3 years ago

Solved by resolving Youtube url

viztea commented 3 years ago

Sorry, https://discord.gg/CH9ubGPMV6