parasop / poru Goto Github PK
View Code? Open in Web Editor NEWA stable and powerful Lavalink client with some best features
License: MIT License
A stable and powerful Lavalink client with some best features
License: MIT License
It is saying that it can not find the module for poru, I am using bun and it is giving me that error. Here is the full error
Could not find a declaration file for module 'poru'. '/home/carter/code/hyperion/node_modules/poru/dist/index.mjs' implicitly has an 'any' type.
There are types at '/home/carter/code/hyperion/node_modules/poru/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'poru' library may need to update its package.json or typings.
https://poru.parasdocs.tech/ does not exist
The player volume seems to be not exposed which results in getting Cannot read properties of undefined (reading 'volume')
error.
The docs wiki doesn't list the volume property either.
Let me know if you're also going to put it in the next update or if there's some mistake I do.
For example, the queue class extends Array, but it most likely would extend Array, since it's an array of tracks.
I am unsure if this was intentional, but if not, it would greatly assist me in using TypeScript.
The Poru class also seems to be missing a few types, such as the return type of the functions decodeTrack(s)
, getLavalinkInfo
, and getLavalinkStatus
.
It's a really great package, but I'm having a bit of trouble with TypeScript regarding missing type declarations.
There's a issue with filters to enable or disable them you need to execute the command twice, Kindly fix this bug
if (!nodes) throw new Error("[Poru Error] You didn't provide a lavalink node");
Error: [Poru Error] You didn't provide a lavalink node
Sometimes it leads us to check the context about what 0 1 2
means, so I think changing them into enum or something like player.loop === "LOOPED_TRACK"
would be preferable.
player.set("track", player.queue.current)
if i do player.get("track")
this will give the info i saved ?I'm in kind a hurry so can you give the information fast as possible
(my bot is currently using erela.js so its getting tons of ram usage)
currently loop method has integer right so it hard to understand so i suggest
disableloop = loop: 'none'
trackloop = loop: 'track'
queueloop loop: 'queue'
change integer and add it string option
so where is the typescript typings?
When playing music in autoplay mode, the check to see if the same music is being played is not carried out.
src/Poru.ts:195 needs to be changed to if (guild) guild.shard.send(packet?.op, packet?.d);
Will there be support for Lavalink 4?
I am facing trackEnd event problem, it doesn't emits I just wanna do that if tracks get over the message gets delete of nowplaying message and I try logging the message(i have access the message) it doesn't gets logs So, I got to know it isn't emitting(i am not sure it's from poru side)
The Logo or Icon Displayed on The Readme it's image link is expired because it's a discord attachment link, Use hosted link or just upload it here in a folder like assets and use it.
Hello I tried the Autoplay() function this last one skips the music by putting a music found by the module but the problem when the music ends it does not try to find another music but it has stopped playing why not put it in the Loop function
https://poru.parasdocs.tech/ does not exist
loading the poru
_loadPlayer() {
this.poru = new Poru(this,nodes,PoruOptions)
return this.poru;
};
-------------------------------------------------------------------------------------------------------------------------
nodes and prouoptions are
const nodes = [
{
name: "node",
host: "hostid",
port: 2020,,
password: "hostpass",
secure: false
}
]
const PoruOptions = {
reconnectTime: 0,
resumeKey: 'MyPlayers',
resumeTimeout: 60,
defaultPlatform: "ytsearch"
}
-------------------------------------------------------------------------------------------------------------------------
load the poru main events
_loadNodeEvents() {
readdirSync("./src/events/Node").forEach(file => {
const event = require(`../events/Node/${file}`);
this.poru.on(event.name, (...args) => event.run(this, ...args));
});
console.log(`Loading Events Lavalink`);
-------------------------------------------------------------------------------------------------------------------------
node connect event
module.exports = {
name: "nodeConnect",
run: async (client, node) => {
console.log(`Node ${node.name} is ready!`)
}
};
why is this not working its load the event but node is not readying
This bug already started for me a month ago.
I am experiencing an issue where music would just stop playing randomly. I get no errors or anything whenever this happens. Lavalink still sends events and still play's music according to the logs, though I think my bot just stops sending voice data to Discord...
if bot reslove track it not give right track it give random one not [0] track it search,
before 2-3 days it working fine now it got broke
add apple music thumbnail img
here is func code
const axios = require('axios');
const cheerio = require('cheerio');
async fetchAppleMusicThumbnailUrl(appleMusicURL) {
try {
const response = await axios.get(appleMusicURL);
const $ = cheerio.load(response.data);
const jsonLdScript = $('script[type="application/ld+json"]').html();
const jsonLdData = JSON.parse(jsonLdScript);
return jsonLdData.image || null;
} catch (error) {
console.error("Error fetching and parsing Apple Music page:", error);
return null;
}
}
Hello, I use the lavalink technique for the music of my discord bot, since I only use spotify as a playback source I sometimes have random encoder returns payload={"encodedTrack":null}
which makes the music crash
Information & version of modules and software used
Poru: 4.2.1
nodejs: 18.17.1
java: 17
lavalink: 3.7.8
lavasrc: 3.2.6
2023-08-19 14:39:09.687 INFO 19906 --- [ader-2-thread-1] lavalink.server.player.AudioLoader : Loaded track You Take My Breath Away - Mono Version
2023-08-19 14:39:09.688 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : GET /v3/loadtracks?identifier=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F3BCMsz55asr7Yr6DqB9N8D, client=127.0.0.1
2023-08-19 14:42:08.295 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/es47eqctusjcm2q7/players/639211220280541194/?noReplace=false, client=127.0.0.1, payload={"encodedTrack":"QAAA2QIACldoYXQgYSBKb2IADkRldmluIFRoZSBEdWRlAAAAAAAFEwIAFjFRcE1OcHprTXhjaE9lWU9uOVJiTkoAAQA1aHR0cHM6Ly9vcGVuLnNwb3RpZnkuY29tL3RyYWNrLzFRcE1OcHprTXhjaE9lWU9uOVJiTkoAB3Nwb3RpZnkBAAxVU1pYVDEwNDE0NDQBAEBodHRwczovL2kuc2Nkbi5jby9pbWFnZS9hYjY3NjE2ZDAwMDBiMjczMzQwMTUyOTAxYWU2MmI2NzdmNzg4MmRkAAAAAAAAAAA="}
2023-08-19 14:42:09.225 INFO 19906 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "https://open.spotify.com/track/27Hl8SDrqAYTr0Gdx5daSM"
2023-08-19 14:42:09.291 INFO 19906 --- [ader-2-thread-1] lavalink.server.player.AudioLoader : Loaded track Bourbon Scars
2023-08-19 14:42:09.293 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : GET /v3/loadtracks?identifier=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F27Hl8SDrqAYTr0Gdx5daSM, client=127.0.0.1
2023-08-19 14:42:38.934 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/es47eqctusjcm2q7/players/639211220280541194/?noReplace=false, client=127.0.0.1, payload={"encodedTrack":"QAAA8AIAJllvdSBUYWtlIE15IEJyZWF0aCBBd2F5IC0gTW9ubyBWZXJzaW9uAAlSZXggU21pdGgAAAAAAAMDTQAWM0JDTXN6NTVhc3I3WXI2RHFCOU44RAABADVodHRwczovL29wZW4uc3BvdGlmeS5jb20vdHJhY2svM0JDTXN6NTVhc3I3WXI2RHFCOU44RAAHc3BvdGlmeQEADFVTU00xMTcwNDI0NAEAQGh0dHBzOi8vaS5zY2RuLmNvL2ltYWdlL2FiNjc2MTZkMDAwMGIyNzNkMTc0MWM5ZjA2ODc2Y2I2MzFjOTY0NmUAAAAAAAAAAA=="}
2023-08-19 14:42:39.947 INFO 19906 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "https://open.spotify.com/track/44kFSc9ud98cnHq104T2RL"
2023-08-19 14:42:40.014 INFO 19906 --- [ader-2-thread-1] lavalink.server.player.AudioLoader : Loaded track Mezmorized
2023-08-19 14:42:40.015 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : GET /v3/loadtracks?identifier=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F44kFSc9ud98cnHq104T2RL, client=127.0.0.1
2023-08-19 14:43:09.293 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/es47eqctusjcm2q7/players/639211220280541194/?noReplace=false, client=127.0.0.1, payload={"encodedTrack":"QAAA2gIADUJvdXJib24gU2NhcnMADFNldGggQW50aG9ueQAAAAAAAmIaABYyN0hsOFNEcnFBWVRyMEdkeDVkYVNNAAEANWh0dHBzOi8vb3Blbi5zcG90aWZ5LmNvbS90cmFjay8yN0hsOFNEcnFBWVRyMEdkeDVkYVNNAAdzcG90aWZ5AQAMVENBRk4yMTUwNzY0AQBAaHR0cHM6Ly9pLnNjZG4uY28vaW1hZ2UvYWI2NzYxNmQwMDAwYjI3MzVmOWQ2ZTdjYTFlNTgwZmJiMmRmYmMwNgAAAAAAAAAA"}
2023-08-19 14:43:09.480 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/es47eqctusjcm2q7/players/639211220280541194/?noReplace=false, client=127.0.0.1, payload={"encodedTrack":null}
2023-08-19 14:43:09.482 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/es47eqctusjcm2q7/players/639211220280541194/?noReplace=false, client=127.0.0.1, payload={"encodedTrack":"QAAA1gIACk1lem1vcml6ZWQAC1dpeiBLaGFsaWZhAAAAAAAEGl0AFjQ0a0ZTYzl1ZDk4Y25IcTEwNFQyUkwAAQA1aHR0cHM6Ly9vcGVuLnNwb3RpZnkuY29tL3RyYWNrLzQ0a0ZTYzl1ZDk4Y25IcTEwNFQyUkwAB3Nwb3RpZnkBAAxVU1FZNTEwODM5MTMBAEBodHRwczovL2kuc2Nkbi5jby9pbWFnZS9hYjY3NjE2ZDAwMDBiMjczNzhhMTIwOGYyYzc4NDJmNDA5ZWM0NTY4AAAAAAAAAAA="}
2023-08-19 14:43:10.245 INFO 19906 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "https://open.spotify.com/track/4NupyFIHhuiSZ9t5zWYzDt"
2023-08-19 14:43:10.298 INFO 19906 --- [ader-2-thread-1] lavalink.server.player.AudioLoader : Loaded track This Girl (Has Turned into a Woman)
2023-08-19 14:43:10.299 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : GET /v3/loadtracks?identifier=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F4NupyFIHhuiSZ9t5zWYzDt, client=127.0.0.1
2023-08-19 14:43:10.556 INFO 19906 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "https://open.spotify.com/track/4D3TbGPrpp6Eiql6ugf7n3"
2023-08-19 14:43:10.633 INFO 19906 --- [ader-2-thread-1] lavalink.server.player.AudioLoader : Loaded track Swervin'
2023-08-19 14:43:10.634 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : GET /v3/loadtracks?identifier=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F4D3TbGPrpp6Eiql6ugf7n3, client=127.0.0.1
2023-08-19 14:47:38.535 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/es47eqctusjcm2q7/players/639211220280541194/?noReplace=false, client=127.0.0.1, payload={"encodedTrack":"QAAA8gIAI1RoaXMgR2lybCAoSGFzIFR1cm5lZCBpbnRvIGEgV29tYW4pAA5NYXJ5IE1hY0dyZWdvcgAAAAAAAyenABY0TnVweUZJSGh1aVNaOXQ1eldZekR0AAEANWh0dHBzOi8vb3Blbi5zcG90aWZ5LmNvbS90cmFjay80TnVweUZJSGh1aVNaOXQ1eldZekR0AAdzcG90aWZ5AQAMVENBQlUxNDQ0MDY2AQBAaHR0cHM6Ly9pLnNjZG4uY28vaW1hZ2UvYWI2NzYxNmQwMDAwYjI3MzE4MjllYTg1YTZlNmI2MDczOTY0NGJmZgAAAAAAAAAA"}
2023-08-19 14:47:39.569 INFO 19906 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "https://open.spotify.com/track/2qDTVDLjK4PctCvC8Mg19x"
2023-08-19 14:47:39.632 INFO 19906 --- [ader-2-thread-1] lavalink.server.player.AudioLoader : Loaded track Diet Coke
2023-08-19 14:47:39.633 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : GET /v3/loadtracks?identifier=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F2qDTVDLjK4PctCvC8Mg19x, client=127.0.0.1
2023-08-19 14:48:09.885 INFO 19906 --- [ XNIO-1 task-2] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/es47eqctusjcm2q7/players/639211220280541194/?noReplace=false, client=127.0.0.1, payload={"encodedTrack":null}
2023-08-19 14:48:09.886 INFO 19906 --- [ XNIO-1 task-1] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/es47eqctusjcm2q7/players/639211220280541194/?noReplace=false, client=127.0.0.1, payload={"encodedTrack":"QAAA0QIACURpZXQgQ29rZQAHUHVzaGEgVAAAAAAAAr/EABYycURUVkRMaks0UGN0Q3ZDOE1nMTl4AAEANWh0dHBzOi8vb3Blbi5zcG90aWZ5LmNvbS90cmFjay8ycURUVkRMaks0UGN0Q3ZDOE1nMTl4AAdzcG90aWZ5AQAMVVNVTTcyMjAxMjE4AQBAaHR0cHM6Ly9pLnNjZG4uY28vaW1hZ2UvYWI2NzYxNmQwMDAwYjI3M2UyN2RmZWY0Mzg1NjJmMmVjYjk4YTY0MgAAAAAAAAAA"}
(I'm unsure but this error happens randomly)
How to do defaultplatform to search, everytime it search ytsearch, im disabled youtube search in lavalink but im idk how to disable it bot side.
hello i’m having issues with the filters so i’m using lavalink v3.6.2 and the filters don’t work i’ll show you the lavalink error if you need it just disconnects from the lavalink server
like current on this repo player.datas = things
add it more easy to get and save like
player.get('datas') or player.data.get('datas')
getting data
player.set('datas', things)
saveing data
player.delete("datas)
deleteing data
like this
2023-07-30 16:45:46.683 INFO 8760 --- [ XNIO-1 task-3] lavalink.server.io.RequestLoggingFilter : DELETE /v3/sessions/x1qfi6uzdpuz4txe/players/997829694273626172, client=127.0.0.1
2023-07-30 16:45:46.684 INFO 8760 --- [ XNIO-1 task-3] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/x1qfi6uzdpuz4txe/players/997829694273626172/?noReplace=false, client=127.0.0.1, payload={"paused":true}
2023-07-30 16:45:46.813 INFO 8760 --- [ XNIO-1 task-3] lavalink.server.io.RequestLoggingFilter : DELETE /v3/sessions/x1qfi6uzdpuz4txe/players/997829694273626172, client=127.0.0.1
2023-07-30 16:45:46.814 INFO 8760 --- [ XNIO-1 task-3] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/x1qfi6uzdpuz4txe/players/997829694273626172/?noReplace=false, client=127.0.0.1, payload={"paused":true}
2023-07-30 16:45:46.936 INFO 8760 --- [ XNIO-1 task-3] lavalink.server.io.RequestLoggingFilter : DELETE /v3/sessions/x1qfi6uzdpuz4txe/players/997829694273626172, client=127.0.0.1
2023-07-30 16:45:46.936 WARN 8760 --- [ XNIO-1 task-3] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Instantiation of [simple type, class dev.arbjerg.lavalink.protocol.v3.VoiceState] value failed for JSON property sessionId due to missing (therefore NULL) value for creator parameter sessionId which is a non-nullable type; nested exception is com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class dev.arbjerg.lavalink.protocol.v3.VoiceState] value failed for JSON property sessionId due to missing (therefore NULL) value for creator parameter sessionId which is a non-nullable type<EOL> at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: dev.arbjerg.lavalink.protocol.v3.VoiceState["sessionId"])]
2023-07-30 16:45:46.937 INFO 8760 --- [ XNIO-1 task-3] lavalink.server.io.RequestLoggingFilter : PATCH /v3/sessions/x1qfi6uzdpuz4txe/players/997829694273626172/?noReplace=false, client=127.0.0.1, payload={"voice":{"sessionId":null,"token":"0732984e6c349577","endpoint":"rotterdam2560.discord.media:443"}}
This concern concerns the Poru customer
Add skip track method ex. player.skip()
why is this package missing so many things
Add search option to select node like my 1 lava server on garman and other on us after i connect german lava it give worng results
i want search it on us node so i request add node name option on search function so i can get what i want result
hello, can you change the leaseusednode option to playercount filter currently it have cpu filtering
on my node 1 it has 100 players
on node 2 on 1 players
there no load balancer at all, can you change the leastusednode
Add more events to poru ex-
playerCreate
=fire if player created
playerDestory
= fire if player get destoryed (is require if user disconnect player from vc or command destory)
playerMove
= fire if player moved (is require for if player moved set new voice channel)
add this events soon as possible
Hi! Thanks for this library.
I develop a discord bot which needs to hear what people say to him and also plays music. I have recently switched from ytdl-core-discord
to Lavalink
and found your library.
I had used const connection = discordJsVoice.getVoiceConnection(guild.id)
to get discord.js connection and then connection.receiver.subscribe
to get user audio stream before. Now I don't see any discord.js connection that I can get inside poru
.
How can I listen to user speaking with poru
?
if players connected to that i removing node it can't be removed
error is coming from here https://github.com/parasop/poru/blob/main/src/Node.js#L71
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.