Tomato6966 / lavalink-client

Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.
https://tomato6966.github.io/lavalink-client/
MIT License
56 stars 23 forks source link

I can't hear the bot but he is "playing" #20

Closed KasaiKonoru closed 6 months ago

KasaiKonoru commented 8 months ago

image I have also no errors in console. But Position is changing all the time. :c

Lavalink Logs: image

Tomato6966 commented 8 months ago

Did you provide voice intents

Do you properly listen to the raw event?

Try the advanceOptions for debugoptions noAudio

KasaiKonoru commented 8 months ago

Yeah Its listen to the raw event. And voice intents are enabled

KasaiKonoru commented 8 months ago

you mean Guild_Voice_States intent, right?

KasaiKonoru commented 8 months ago

And how you mean "Try the advanceOptions for debugoptions noAudio" I don't understand how.

KasaiKonoru commented 8 months ago

Ahhh nvm it works now. My bad.

But now I tried custom url mp3's but I get the error: "Not a valid URL." Where I can enable custom url plays?

Tomato6966 commented 7 months ago

http urls needs to be enabled in application.yml from lavalink...

Tomato6966 commented 7 months ago

As you can see in the example bot: https://github.com/Tomato6966/lavalink-client/blob/main/testBot/index.ts you can add the advancedOptions.debugOptions.noAudio = true


client.lavalink = new LavalinkManager({
 // ...
  advancedOptions: {
        debugOptions: {
            noAudio: true
        }
    }
})
KasaiKonoru commented 7 months ago

Thx for your response...

http urls needs to be enabled in application.yml from lavalink...

yeah I enabled "local" and "http" (I set them to true)

KasaiKonoru commented 7 months ago

application.txt This are my settings. (I changed it to txt because github dont want yaml files)

1Lucas1apk commented 7 months ago

I noticed that in your Lavalink log, there is no voice information You added the sendRawData() function? https://github.com/Tomato6966/lavalink-client/blob/main/testBot/events/raw.ts

KasaiKonoru commented 7 months ago

all is working, but only http requests not.

And I have a question: How I can search for track without an active player? I want to search first and then create the player, whenj something is found.

KasaiKonoru commented 7 months ago

Nvm http is working. A lavalink dev said me: "spaces need to be properly encoded in urls". Now it works. But how I can search for tracks without an active player?

1Lucas1apk commented 7 months ago

By node: https://github.com/Tomato6966/lavalink-client/blob/f0007b83bd1cb2811b3efc69b28f9d5ed15b0591/src/structures/Node.ts#L307

KasaiKonoru commented 7 months ago

Ahh you mean something like that? client.manager.nodeManager.nodes.get("main").search()

1Lucas1apk commented 7 months ago

Yes, I hadn't seen that one either :)

KasaiKonoru commented 7 months ago

lol xD But whats the best method?

Tomato6966 commented 7 months ago

The best method is to search by creating a player. That way you don't have to mind for "checking if the song searched on node X is the same as the node of the player created later"

The player creation is almost instant, so no reason not to create a player.

const player = client.manager.createPlayer({ guildId: "" }); 
const res = await player.search({ query, source }, requesterUser);

You can create player without providing the voiceChannelId too... if you want him to connect later without re-creating it, simply do:

player.options.voiceChannelId = "vcId";
await player.connect();
KasaiKonoru commented 7 months ago

Okay thanks