<MoonlinkPlayer>.skip() bug

When using the skip method, the <MoonlinkPlayer>.playing is returned to false
96 Replies
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
NodeLink Server Log
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
When I checked about the MoonlinkPlayer by eval (two queues and skip)
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
No trackStart event occurs either
continuing-cyan
continuing-cyanโ€ข11mo ago
Coincidence, that's a bug I literally fixed some few hours ago Just update your NodeLink and it should be fine Sorry for the trouble
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
Ahh i will try
continuing-cyan
continuing-cyanโ€ข11mo ago
(For updating NL, just git pull)
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
same happened
continuing-cyan
continuing-cyanโ€ข11mo ago
Mind providing newest logs from NL? & could provide me what's the output of the command git log?
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
give me second
continuing-cyan
continuing-cyanโ€ข11mo ago
Sure
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
never mind now its work ๐Ÿ˜‚
continuing-cyan
continuing-cyanโ€ข11mo ago
If you have any other bug with NodeLink, feel free to create a GitHub issue instead The logs are very useful to know if it's a NodeLink bug or a client bug. If they don't say anything, and it should, then it's NodeLink mostly LMAO Feel free to DM me for any bug confirmation, but hopefully you won't find any more :)
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
Thank you for always actively helping ๐Ÿ™‚ I thought I wrote the code wrong
continuing-cyan
continuing-cyanโ€ข11mo ago
And thanks for supporting small projects ^^ ๐Ÿคฃ I'm sorry for the trouble btw
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
@ThePedroo Sorry for ping When playing a song, I try to adjust the sound using <MoonlinkPlayer>.setVolume(), but it's not a NodeLink problem to return the error just because the player hasn't played yet, right?
continuing-cyan
continuing-cyanโ€ข11mo ago
I wouldn't define it as a problem as this is made on purpose But if you either try to pause or stop a player which doesn't have a playing player, it will do that not set volume though Also, dw about pinging me, I preffer that people ping me or else I won't see it till maybe days
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
The user tried to set the volume value when trying to play the song. But I don't think the player was created in the meantime
MEE6
MEE6โ€ข11mo ago
GG @Jasper, you just advanced to level 3!
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
No description
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
like that
continuing-cyan
continuing-cyanโ€ข11mo ago
Mind enabling all logs in config.js and showing the logs?
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
NodeLink ?
continuing-cyan
continuing-cyanโ€ข11mo ago
Yes, there is a logging called all
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
Are these logs correct?
continuing-cyan
continuing-cyanโ€ข11mo ago
Kinda of, let me see the crash in the end It's weird how some people can get some issues others can't
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
Sorry ๐Ÿ˜‚
continuing-cyan
continuing-cyanโ€ข11mo ago
For what? ๐Ÿ‘€
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
I mean, I'm sorry that I brought so many weird errors ๐Ÿ˜ญ
continuing-cyan
continuing-cyanโ€ข11mo ago
Oh, I love when people send me then Makes the project more stable
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
If i provide a delay with setTimeout, there will be no problem, but if i process it with then, an error will occur
No description
continuing-cyan
continuing-cyanโ€ข11mo ago
Anyway, this happened because the client disconnected before NodeLink could actually process the play request -- so I'm not sending it to you a fix for that right now to wait me find a proper solution and send to the repo, as it's not an urgency However we must find the reason of why the client is disconnecting Mind providing your bot logs?
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
Probably can't wait on Moonlink for Player to be created
continuing-cyan
continuing-cyanโ€ข11mo ago
Some error is causing Moonlink to disconnect in this case
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
[nodemon] restarting due to changes...
[nodemon] starting `ts-node ./src/app.ts`
[info] 2024-03-10 15:10:03.707 | [EVENT HANDLER] :: Loading events from client...
[info] 2024-03-10 15:10:03.713 | [COMMAND HANDLER] :: Loading command from dev category...
[info] 2024-03-10 15:10:03.715 | [COMMAND HANDLER] :: Loading command from general category...
[info] 2024-03-10 15:10:03.716 | [COMMAND HANDLER] :: Loading command from moderator category...
[info] 2024-03-10 15:10:05.171 | [EVENT HANDLER] :: Loaded event: Debug
[info] 2024-03-10 15:10:05.172 | [COMMAND HANDLER] :: Loaded command: [dev] eval
[info] 2024-03-10 15:10:05.173 | [COMMAND HANDLER] :: Loaded command: [general] Music
[info] 2024-03-10 15:10:05.173 | [COMMAND HANDLER] :: Loaded command: [general] Ping
[info] 2024-03-10 15:10:05.174 | [COMMAND HANDLER] :: Loaded command: [moderator] Ban
[info] 2024-03-10 15:10:05.175 | [COMMAND HANDLER] :: Loaded command: [moderator] Kick
[info] 2024-03-10 15:10:05.176 | [COMMAND HANDLER] :: Loaded command: [moderator] Warn
[info] 2024-03-10 15:10:05.238 | [EVENT HANDLER] :: Loaded event: Raw
[info] 2024-03-10 15:10:05.240 | [COMMAND HANDLER] :: Started refreshing application (/) commands.
[info] 2024-03-10 15:10:05.304 | [EVENT HANDLER] :: Loaded event: Ready
[info] 2024-03-10 15:10:05.305 | [EVENT HANDLER] :: Loading events from interaction...
[info] 2024-03-10 15:10:05.474 | [EVENT HANDLER] :: Loaded event: Command
[info] 2024-03-10 15:10:05.474 | [EVENT HANDLER] :: Total loaded events: 4
[debug] 2024-03-10 15:10:05.488 | [CLIENT] :: [WS => Shard 0] Shard received all its guilds. Marking as fully ready.
[info] 2024-03-10 15:10:05.489 | [CLIENT] :: Logged in as typescript-bot#7963
[info] 2024-03-10 15:10:05.495 | [MUSIC NODE] :: 192.168.0.99 connected
[info] 2024-03-10 15:10:05.810 | [COMMAND HANDLER] :: Successfully loaded application 6 (/) commands.
[debug] 2024-03-10 15:10:05.882 | [MUSIC NODE] :: 192.168.0.99 raw data:
{ op: 'ready', resumed: false, sessionId: 'IHriKaplS7gLBkw7' }
[info] 2024-03-10 15:10:05.888 | [MUSIC NODE] :: 192.168.0.99 (IHriKaplS7gLBkw7) is ready! (resumed: false)
[debug] 2024-03-10 15:10:11.510 | [CLIENT] :: [VOICE] received voice state update: {"member":{"user":{"username":"typescript-bot","public_flags":0,"id":"1205081467277803560","global_name":null,"display_name":null,"discriminator":"7963","bot":true,"avatar_decoration_data":null,"avatar":null},"roles":["1205083491000385546"],"premium_since":null,"pending":false,"nick":null,"mute":false,"joined_at":"2024-02-08T09:31:33.697000+00:00","flags":0,"deaf":false,"communication_disabled_until":null,"avatar":null},"user_id":"1205081467277803560","suppress":false,"session_id":"17e72829edd7e3b79cb4de359327db6d","self_video":false,"self_mute":false,"self_deaf":true,"request_to_speak_timestamp":null,"mute":false,"guild_id":"1163120824975380601","deaf":false,"channel_id":"1205775495069827093"}
[debug] 2024-03-10 15:10:12.238 | [CLIENT] :: [VOICE] received voice server: {"t":"VOICE_SERVER_UPDATE","s":7,"op":0,"d":{"token":"8d90ec26a321900e","guild_id":"1163120824975380601","endpoint":"south-korea1115.discord.media:443"}}
D:\develop\typescript-bot\node_modules\moonlink.js\dist\src\@Entities\MoonlinkPlayer.js:276
throw new Error("@Moonlink(Player) - cannot change volume while the player is not playing");
^
Error: @Moonlink(Player) - cannot change volume while the player is not playing
at MoonlinkPlayer.setVolume (D:\develop\typescript-bot\node_modules\moonlink.js\dist\src\@Entities\MoonlinkPlayer.js:276:19)
at D:\develop\typescript-bot\src\commands\general\Music.ts:220:30
at processTicksAndRejections (node:internal/process/task_queues:95:5)
[nodemon] restarting due to changes...
[nodemon] starting `ts-node ./src/app.ts`
[info] 2024-03-10 15:10:03.707 | [EVENT HANDLER] :: Loading events from client...
[info] 2024-03-10 15:10:03.713 | [COMMAND HANDLER] :: Loading command from dev category...
[info] 2024-03-10 15:10:03.715 | [COMMAND HANDLER] :: Loading command from general category...
[info] 2024-03-10 15:10:03.716 | [COMMAND HANDLER] :: Loading command from moderator category...
[info] 2024-03-10 15:10:05.171 | [EVENT HANDLER] :: Loaded event: Debug
[info] 2024-03-10 15:10:05.172 | [COMMAND HANDLER] :: Loaded command: [dev] eval
[info] 2024-03-10 15:10:05.173 | [COMMAND HANDLER] :: Loaded command: [general] Music
[info] 2024-03-10 15:10:05.173 | [COMMAND HANDLER] :: Loaded command: [general] Ping
[info] 2024-03-10 15:10:05.174 | [COMMAND HANDLER] :: Loaded command: [moderator] Ban
[info] 2024-03-10 15:10:05.175 | [COMMAND HANDLER] :: Loaded command: [moderator] Kick
[info] 2024-03-10 15:10:05.176 | [COMMAND HANDLER] :: Loaded command: [moderator] Warn
[info] 2024-03-10 15:10:05.238 | [EVENT HANDLER] :: Loaded event: Raw
[info] 2024-03-10 15:10:05.240 | [COMMAND HANDLER] :: Started refreshing application (/) commands.
[info] 2024-03-10 15:10:05.304 | [EVENT HANDLER] :: Loaded event: Ready
[info] 2024-03-10 15:10:05.305 | [EVENT HANDLER] :: Loading events from interaction...
[info] 2024-03-10 15:10:05.474 | [EVENT HANDLER] :: Loaded event: Command
[info] 2024-03-10 15:10:05.474 | [EVENT HANDLER] :: Total loaded events: 4
[debug] 2024-03-10 15:10:05.488 | [CLIENT] :: [WS => Shard 0] Shard received all its guilds. Marking as fully ready.
[info] 2024-03-10 15:10:05.489 | [CLIENT] :: Logged in as typescript-bot#7963
[info] 2024-03-10 15:10:05.495 | [MUSIC NODE] :: 192.168.0.99 connected
[info] 2024-03-10 15:10:05.810 | [COMMAND HANDLER] :: Successfully loaded application 6 (/) commands.
[debug] 2024-03-10 15:10:05.882 | [MUSIC NODE] :: 192.168.0.99 raw data:
{ op: 'ready', resumed: false, sessionId: 'IHriKaplS7gLBkw7' }
[info] 2024-03-10 15:10:05.888 | [MUSIC NODE] :: 192.168.0.99 (IHriKaplS7gLBkw7) is ready! (resumed: false)
[debug] 2024-03-10 15:10:11.510 | [CLIENT] :: [VOICE] received voice state update: {"member":{"user":{"username":"typescript-bot","public_flags":0,"id":"1205081467277803560","global_name":null,"display_name":null,"discriminator":"7963","bot":true,"avatar_decoration_data":null,"avatar":null},"roles":["1205083491000385546"],"premium_since":null,"pending":false,"nick":null,"mute":false,"joined_at":"2024-02-08T09:31:33.697000+00:00","flags":0,"deaf":false,"communication_disabled_until":null,"avatar":null},"user_id":"1205081467277803560","suppress":false,"session_id":"17e72829edd7e3b79cb4de359327db6d","self_video":false,"self_mute":false,"self_deaf":true,"request_to_speak_timestamp":null,"mute":false,"guild_id":"1163120824975380601","deaf":false,"channel_id":"1205775495069827093"}
[debug] 2024-03-10 15:10:12.238 | [CLIENT] :: [VOICE] received voice server: {"t":"VOICE_SERVER_UPDATE","s":7,"op":0,"d":{"token":"8d90ec26a321900e","guild_id":"1163120824975380601","endpoint":"south-korea1115.discord.media:443"}}
D:\develop\typescript-bot\node_modules\moonlink.js\dist\src\@Entities\MoonlinkPlayer.js:276
throw new Error("@Moonlink(Player) - cannot change volume while the player is not playing");
^
Error: @Moonlink(Player) - cannot change volume while the player is not playing
at MoonlinkPlayer.setVolume (D:\develop\typescript-bot\node_modules\moonlink.js\dist\src\@Entities\MoonlinkPlayer.js:276:19)
at D:\develop\typescript-bot\src\commands\general\Music.ts:220:30
at processTicksAndRejections (node:internal/process/task_queues:95:5)
continuing-cyan
continuing-cyanโ€ข11mo ago
Ahh, that's a internal Moonlink error I thought it was a nodelink error ๐Ÿคฃ
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
yeah thats right XD
continuing-cyan
continuing-cyanโ€ข11mo ago
The most appropriate case for this would be listening to trackStart event and set it
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
umm
continuing-cyan
continuing-cyanโ€ข11mo ago
orrrrrrrrrrr
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
I think that would be good, too
continuing-cyan
continuing-cyanโ€ข11mo ago
sending the volume together with play Sending together is more appropriate
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
If i do this, it'll be output at the default sound value for about a second
continuing-cyan
continuing-cyanโ€ข11mo ago
Yeah I thought that first but then I realized there are better ways
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
If I do this, the Player will be created late, and the same error will occur
continuing-cyan
continuing-cyanโ€ข11mo ago
Not really It will be sent in the same payload Let me see if I can find the example which does that
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
Async function included play and set volume method and exec wrong code?
continuing-cyan
continuing-cyanโ€ข11mo ago
NodeLink accuses it to be sending volume 80% on-the-play So somewhere does that
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
umm
continuing-cyan
continuing-cyanโ€ข11mo ago
Before .play Use player.volume = selected_data?.volume || 50
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
Does it mean to set the <MoonlinkPlayer>.volume property?
continuing-cyan
continuing-cyanโ€ข11mo ago
Yes
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
Its work :happypepe:
continuing-cyan
continuing-cyanโ€ข11mo ago
@1Lucas1.apk Aliรกs, vocรช tem que rever isso Porque nรฃo tem como fazer o que ele quer sem fazer dessa forma -- exceto se for assim mesmo que tu queria que fizessem
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
3|NodeLink Server | [ALL]: Received a request from client.
3|NodeLink Server | Path: /v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: "{\"voice\":{\"sessionId\":\"39b51df23fb1ecb3f9e63dd76c35d676\",\"endpoint\":\"south-korea1115.discord.media:443\",\"token\":\"7b8b0d83d5e3590e\"}}"
3|NodeLink Server | [voice]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: {"voice":{"sessionId":"39b51df23fb1ecb3f9e63dd76c35d676","endpoint":"south-korea1115.discord.media:443","token":"7b8b0d83d5e3590e"}}
3|NodeLink Server | [search]: Found 19 tracks on YouTube for query 7 Years
3|NodeLink Server | [ALL]: Received a request from client.
3|NodeLink Server | Path: /v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: "{\"track\":{\"encoded\":\"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA\"},\"volume\":30}"
3|NodeLink Server | [play]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: {"track":{"encoded":"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA"},"volume":30}
3|NodeLink Server | [volume]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Body: {"track":{"encoded":"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA"},"volume":30}
3|NodeLink Server | [trackStart]: Lukas Graham - 7 Years [Official Music Video] by Lukas Graham.
3|NodeLink Server | [ALL]: Received a request from client.
3|NodeLink Server | Path: /v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: "{\"voice\":{\"sessionId\":\"39b51df23fb1ecb3f9e63dd76c35d676\",\"endpoint\":\"south-korea1115.discord.media:443\",\"token\":\"7b8b0d83d5e3590e\"}}"
3|NodeLink Server | [voice]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: {"voice":{"sessionId":"39b51df23fb1ecb3f9e63dd76c35d676","endpoint":"south-korea1115.discord.media:443","token":"7b8b0d83d5e3590e"}}
3|NodeLink Server | [search]: Found 19 tracks on YouTube for query 7 Years
3|NodeLink Server | [ALL]: Received a request from client.
3|NodeLink Server | Path: /v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: "{\"track\":{\"encoded\":\"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA\"},\"volume\":30}"
3|NodeLink Server | [play]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Headers: {"content-type":"application/json","accept-encoding":"br","authorization":"REDACTED","host":"REDACTED","connection":"keep-alive","transfer-encoding":"chunked"}
3|NodeLink Server | Body: {"track":{"encoded":"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA"},"volume":30}
3|NodeLink Server | [volume]: Received a request from client.
3|NodeLink Server | Params: "/v4/sessions/7Z6VSFLnEslWJ4kR/players/1163120824975380601"
3|NodeLink Server | Body: {"track":{"encoded":"QAAAywMALUx1a2FzIEdyYWhhbSAtIDcgWWVhcnMgW09mZmljaWFsIE11c2ljIFZpZGVvXQAMTHVrYXMgR3JhaGFtAAAAAAADqYAAC0xIQ29iNzZraWdBAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9TEhDb2I3NmtpZ0EBADRodHRwczovL2kueXRpbWcuY29tL3ZpL0xIQ29iNzZraWdBL21heHJlc2RlZmF1bHQuanBnAAAHeW91dHViZQAAAAAAAAAA"},"volume":30}
3|NodeLink Server | [trackStart]: Lukas Graham - 7 Years [Official Music Video] by Lukas Graham.
continuing-cyan
continuing-cyanโ€ข11mo ago
The NL logs seems fine
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
Yeah ๐Ÿ™‚
continuing-cyan
continuing-cyanโ€ข11mo ago
Awesome! :) Lmk if you have any further issues or questions
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
I'm always grateful that you've helped me in something that's not a big deal โค๏ธ
continuing-cyan
continuing-cyanโ€ข11mo ago
That's what I call open source community ^^
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
But his If is wrong... If(player.playing) without the question mark, it will try to emit every time it is not playing
continuing-cyan
continuing-cyanโ€ข11mo ago
Wouldn't affect anything at normal case though
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
Affects
continuing-cyan
continuing-cyanโ€ข11mo ago
Nรฃo afeta o problema que ele queria resolver Ele queria setar o volume ao tocar
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
Tentar mudar um volume em um player que nรฃo tรก tocando??
continuing-cyan
continuing-cyanโ€ข11mo ago
Nรฃo Ele queria setar o volume on-the-play
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
ร‰ o que o comando faz
continuing-cyan
continuing-cyanโ€ข11mo ago
Mas a รบnica forma de fazer isso รฉ mudando o this.volume direto Isso nรฃo รฉ on-the-play, ele nรฃo vai junto ao pedido pra tocar Precisa ser no mesmo payload
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
Sรณ era colocar no create
continuing-cyan
continuing-cyanโ€ข11mo ago
Seria รบtil no play tu deixar a pessoa fazer on-the-play de qualquer forma ร‰ รบtil pra reduzir latรชncia porque aรญ vai tudo no mesmo request
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
Vou encher de ifs se eu fizer
continuing-cyan
continuing-cyanโ€ข11mo ago
KKKKK รฉ sรณ adicionar um parรขmetro no play pra enviar coisa junta
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
Usa create
continuing-cyan
continuing-cyanโ€ข11mo ago
Mas e depois no segundo play e se ele quiser alterar o volume?
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
Altera o parรขmetro
continuing-cyan
continuing-cyanโ€ข11mo ago
Qual?
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
volume
continuing-cyan
continuing-cyanโ€ข11mo ago
this.volume?
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
Ele รฉ sempre acionado junto com o play
continuing-cyan
continuing-cyanโ€ข11mo ago
Se for o this.volume foi oq foi usado mesmo
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
GitHub
moonlink.js/src/@Entities/MoonlinkPlayer.ts at v3 ยท Ecliptia/moonli...
MoonLink.js is a simple package for lavalink client, perfect for you to create your discord bot with songs, and very simple and easy to use. - Ecliptia/moonlink.js
continuing-cyan
continuing-cyanโ€ข11mo ago
Sim, por isso eu falei pra usar o this.volume Aliรกs, eu nรฃo tinha achado como alterar o volume no create
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
what happened
MEE6
MEE6โ€ข11mo ago
GG @Jasper, you just advanced to level 4!
continuing-cyan
continuing-cyanโ€ข11mo ago
^ Seems like you also set the volume on the create function too
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
When using the command, we implemented the track to be selected and played by the user based on the search. I was just trying to adjust the volume based on the selection.
const query = interaction.options.getString("์ฟผ๋ฆฌ", true);

if (!voiceChannel.joinable)
return interaction.reply({
content: `๋ด‡์ด ํ•ด๋‹น ์Œ์„ฑ์ฑ„๋„์— ์ž…์žฅํ•  ์ˆ˜ ์žˆ๋Š” ๊ถŒํ•œ์ด ์—†์Šต๋‹ˆ๋‹ค.`
});

const player = client.music.player.players.create({
guildId: interaction.guild.id,
voiceChannel: voiceChannel.id,
textChannel: interaction.channel.id,
autoPlay: selected_data ? Boolean(selected_data.autoPlay) : true,
autoLeave: selected_data ? Boolean(selected_data.autoLeave) : false
});

player.volume = selected_data ? selected_data.volume : 50;

if (!player.connected) {
player.connect({
setDeaf: true,
setMute: false
});
}

const res = await client.music.player.search({
query,
source: "youtube",
requester: interaction.user.id
});

if (res.loadType === "error") {
return interaction.reply({
content: `์–ด๋ผ.. ํ˜„์žฌ ์‹œ์Šคํ…œ์ด ์›ํ™œํ•˜์ง€ ์•Š์€ ๋ชจ์–‘์ด์—์š”. ์‹œ๊ฐ„ ์ง€๋‚˜๊ณ  ๋‹ค์‹œ ์‹œ๋„ํ•ด ๋ณด๋ฉด ๋  ๊ฑฐ์˜ˆ์š”!`
});
} else if (res.loadType === "empty") {
return interaction.reply({
content: `\`${query}\`์— ๋Œ€ํ•ด ๊ฒ€์ƒ‰ํ•ด๋ดค๋Š”๋ฐ ์ฐพ์„ ์ˆ˜ ์—†์–ด์š”.`
});
}

if (res.loadType === "playlist") {
interaction.reply({
content: `\`${res.playlistInfo?.name}\` ํ•ด๋‹น ํ”Œ๋ ˆ์ด๋ฆฌ์ŠคํŠธ์— ๋Œ€ํ•ด ๋Œ€๊ธฐ์—ด์— ์ถ”๊ฐ€ํ–ˆ์–ด์š”.`
});

for (const track of res.tracks) {
player.queue.add(track);
}
} else {
const selectMenu = new StringSelectMenuBuilder()
.setCustomId("select_track")
.setPlaceholder("๋…ธ๋ž˜๋ฅผ ์„ ํƒํ•ด์ฃผ์„ธ์š”.")
.addOptions(
res.tracks.slice(0, 25).map((track) => ({
label:
track.title.length > 100
? track.title.slice(0, 97) + "..."
: track.title,
description:
track.author.length > 50
? track.author.slice(0, 47) + "..."
: track.author,
value: track.identifier
}))
);

const row =
new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(
selectMenu
);

const response = await interaction.reply({
content:
"์ž…๋ ฅํ•˜์‹  ์ฟผ๋ฆฌ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์•„๋ž˜์˜ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•˜์˜€์Šต๋‹ˆ๋‹ค.",
components: [row]
});

const collectorFilter = (i: { user: { id: string } }) =>
i.user.id === interaction.user.id;
try {
const confirmation = await response.awaitMessageComponent({
filter: collectorFilter,
time: 30_000,
componentType: ComponentType.StringSelect
});

if (confirmation.customId === "select_track") {
const selectedTrack = res.tracks.find(
(track) => track.identifier === confirmation.values[0]
);

if (selectedTrack) {
player.queue.add(selectedTrack);
await confirmation.update({
content: `\`${selectedTrack.title} - ${await client.date.millisecondsToDuration(selectedTrack.duration)}\` ํ•ด๋‹น ๋…ธ๋ž˜๋ฅผ ๋Œ€๊ธฐ์—ด์— ์ถ”๊ฐ€ํ–ˆ์–ด์š”.`,
components: []
});
if (!player.playing) {
player.play();
// player.setVolume();
}
}
}
} catch (e) {
await interaction.editReply({
content: "์ œํ•œ ์‹œ๊ฐ„ ๋‚ด์— ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด์ง€ ์•Š์•„ ์ทจ์†Œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.",
components: []
});
}
}
const query = interaction.options.getString("์ฟผ๋ฆฌ", true);

if (!voiceChannel.joinable)
return interaction.reply({
content: `๋ด‡์ด ํ•ด๋‹น ์Œ์„ฑ์ฑ„๋„์— ์ž…์žฅํ•  ์ˆ˜ ์žˆ๋Š” ๊ถŒํ•œ์ด ์—†์Šต๋‹ˆ๋‹ค.`
});

const player = client.music.player.players.create({
guildId: interaction.guild.id,
voiceChannel: voiceChannel.id,
textChannel: interaction.channel.id,
autoPlay: selected_data ? Boolean(selected_data.autoPlay) : true,
autoLeave: selected_data ? Boolean(selected_data.autoLeave) : false
});

player.volume = selected_data ? selected_data.volume : 50;

if (!player.connected) {
player.connect({
setDeaf: true,
setMute: false
});
}

const res = await client.music.player.search({
query,
source: "youtube",
requester: interaction.user.id
});

if (res.loadType === "error") {
return interaction.reply({
content: `์–ด๋ผ.. ํ˜„์žฌ ์‹œ์Šคํ…œ์ด ์›ํ™œํ•˜์ง€ ์•Š์€ ๋ชจ์–‘์ด์—์š”. ์‹œ๊ฐ„ ์ง€๋‚˜๊ณ  ๋‹ค์‹œ ์‹œ๋„ํ•ด ๋ณด๋ฉด ๋  ๊ฑฐ์˜ˆ์š”!`
});
} else if (res.loadType === "empty") {
return interaction.reply({
content: `\`${query}\`์— ๋Œ€ํ•ด ๊ฒ€์ƒ‰ํ•ด๋ดค๋Š”๋ฐ ์ฐพ์„ ์ˆ˜ ์—†์–ด์š”.`
});
}

if (res.loadType === "playlist") {
interaction.reply({
content: `\`${res.playlistInfo?.name}\` ํ•ด๋‹น ํ”Œ๋ ˆ์ด๋ฆฌ์ŠคํŠธ์— ๋Œ€ํ•ด ๋Œ€๊ธฐ์—ด์— ์ถ”๊ฐ€ํ–ˆ์–ด์š”.`
});

for (const track of res.tracks) {
player.queue.add(track);
}
} else {
const selectMenu = new StringSelectMenuBuilder()
.setCustomId("select_track")
.setPlaceholder("๋…ธ๋ž˜๋ฅผ ์„ ํƒํ•ด์ฃผ์„ธ์š”.")
.addOptions(
res.tracks.slice(0, 25).map((track) => ({
label:
track.title.length > 100
? track.title.slice(0, 97) + "..."
: track.title,
description:
track.author.length > 50
? track.author.slice(0, 47) + "..."
: track.author,
value: track.identifier
}))
);

const row =
new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(
selectMenu
);

const response = await interaction.reply({
content:
"์ž…๋ ฅํ•˜์‹  ์ฟผ๋ฆฌ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์•„๋ž˜์˜ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•˜์˜€์Šต๋‹ˆ๋‹ค.",
components: [row]
});

const collectorFilter = (i: { user: { id: string } }) =>
i.user.id === interaction.user.id;
try {
const confirmation = await response.awaitMessageComponent({
filter: collectorFilter,
time: 30_000,
componentType: ComponentType.StringSelect
});

if (confirmation.customId === "select_track") {
const selectedTrack = res.tracks.find(
(track) => track.identifier === confirmation.values[0]
);

if (selectedTrack) {
player.queue.add(selectedTrack);
await confirmation.update({
content: `\`${selectedTrack.title} - ${await client.date.millisecondsToDuration(selectedTrack.duration)}\` ํ•ด๋‹น ๋…ธ๋ž˜๋ฅผ ๋Œ€๊ธฐ์—ด์— ์ถ”๊ฐ€ํ–ˆ์–ด์š”.`,
components: []
});
if (!player.playing) {
player.play();
// player.setVolume();
}
}
}
} catch (e) {
await interaction.editReply({
content: "์ œํ•œ ์‹œ๊ฐ„ ๋‚ด์— ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด์ง€ ์•Š์•„ ์ทจ์†Œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.",
components: []
});
}
}
For now, I wrote the code as above.
continuing-cyan
continuing-cyanโ€ข11mo ago
To change the volume on-the-play, seems like this is the only way
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
i think so
continuing-cyan
continuing-cyanโ€ข11mo ago
@1Lucas1.apk ?
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
It's been a while since I've studied typescript, so the code can be terrible ๐Ÿ˜‚
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
GitHub
moonlink.js/src/@Entities/MoonlinkPlayer.ts at v3 ยท Ecliptia/moonli...
MoonLink.js is a simple package for lavalink client, perfect for you to create your discord bot with songs, and very simple and easy to use. - Ecliptia/moonlink.js
1Lucas1.apk
1Lucas1.apkโ€ข11mo ago
Tudo que vem do construtor รฉ usado Desde autoPlay atรฉ node Se quiser colocar que ele jรก venha com connected e playing pode atรฉ colocar ๐Ÿ˜˜
continuing-cyan
continuing-cyanโ€ข11mo ago
ATA Por isso que nรฃo vi explicitamente As long as it works -- but it's always important to keep the code clean
์ œ์Šคํผ
์ œ์ŠคํผOPโ€ข11mo ago
I'll do my best. ๐Ÿ™‚
continuing-cyan
continuing-cyanโ€ข11mo ago
If you need any help with making a code more readable, count on us too :)