Bot disconnects
When the bot plays it music (for me its a radio station) and when I disconnect the bot throughout discord itself "Disconnect <botname>" the bot doesn't re-connect, also doesn't re-connect when re-entering the command. I have to restart the entire discord bot for it.
Is there a different way for this?
138 Replies
I didn't quite understand what you meant, could you explain better?
unwilling-turquoiseOPβ’2y ago
Basically, I have my play command that plays a radio station through my URL. It succesfully plays, and it works. But when I disconnect the bot throughout the discord menu, it doesn't want to re-connect. Re-entering the /play command doesn't let it re-connect either.
A little snippet I can show.
unwilling-turquoiseOPβ’2y ago
You understand now?
I understood
On the play command, the connet is like
If connected is not being updated, I will have to check the package codes to find my possible error
unwilling-turquoiseOPβ’2y ago
I could rq share you the code I have right now. I have already player.connected.
https://sourceb.in/wY1P0JM68n
So, I will analyze the moonlink.js codes, and in a few minutes I will publish a version correcting this
unwilling-turquoiseOPβ’2y ago
Ah, thanks. Please mention me when the version has been released π
He is well
unwilling-turquoiseOPβ’2y ago
What?
GG @Justin, you just advanced to level 1!
I meant, okay
GitHub
moonlink.js/src/@Moonlink/MoonlinkManager.ts at v2 Β· 1Lucas1apk/moo...
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. Support Server: https://discord.gg/xQq2A8vku3 - 1Lucas1...
The part appears to be working correctly when the player is disconnected.
I'm just checking to make sure I didn't add any additional code to the bot
unwilling-turquoiseOPβ’2y ago
I see you are testing right now, but you have to force disconnect the bot, not wait until the bot is done playing.
Play a song, force disconnect the discord bot, and then try playing it again.
Then it happend by me.
Which version of nodejs do you use?
unwilling-turquoiseOPβ’2y ago
v18.18.0
afraid-scarletβ’2y ago
But if we had a nodejs below 18.18.0 wouldn't this still work?
Below versions 18, many errors were occurring
As data was not being treated correctly in some classes
afraid-scarletβ’2y ago
Ok cool no worries, thought I would ask about that.
Now I want to understand why the playerDisconnected is not being issued
afraid-scarletβ’2y ago
Would the playerDisconnected still work even if the bot was removed from the voice channel? π€
There is a way to make it destroy the player using a Discord.js event
Wait quickly
other-emeraldβ’2y ago
(i am the leader of this project)
do we try this?
Could you test this code?
afraid-scarletβ’2y ago
Cool it works
Have a great day π
afraid-scarletβ’2y ago
Would this work away from client.on? so creating its own file?
unwilling-turquoiseOPβ’2y ago
Basically an 'external file'
afraid-scarletβ’2y ago
Just cause we are facing an err when trying it.
other-emeraldβ’2y ago
ye
unwilling-turquoiseOPβ’2y ago
Cause this is my external file,
And then it returns with
TypeError: Cannot read properties of undefined (reading 'player')
other-emeraldβ’2y ago
that's probably because moon is not defined
other-emeraldβ’2y ago
you copied our code, congrats
afraid-scarletβ’2y ago
Yes, if we do that its sending any err don't worry :)
GG @Connor200024, you just advanced to level 1!
afraid-scarletβ’2y ago
I will figure this out :D
thanks for the fix and letting us know the issue.
Have a great day π
afraid-scarletβ’2y ago
Same to you :)
other-emeraldβ’2y ago
π
π
π
π
π€‘
afraid-scarletβ’2y ago
Cool guy Lucas is ;)
unwilling-turquoiseOPβ’2y ago
So how to use it in an external file?
I don't understand, from what I saw, it exports the client, and you already assigned a value to client.moon, from what I saw in the command
If the external file imports the client, client.moon will go with it
other-emeraldβ’2y ago
it imports the client
GG @Jul πΉ, you just advanced to level 1!
unwilling-turquoiseOPβ’2y ago
It keeps giving me this error,
TypeError: Cannot read properties of undefined (reading 'players')
other-emeraldβ’2y ago
it cant find client.moon.player or players
See what returns from client.moon
unwilling-turquoiseOPβ’2y ago
alright one sec
GG @Justin, you just advanced to level 2!
unwilling-turquoiseOPβ’2y ago
undefined
See if the client returns
unwilling-turquoiseOPβ’2y ago
client returns
How do you assign moonlink.js to client.moon?
π€‘
unwilling-turquoiseOPβ’2y ago
I just copied over your code from the Github Repo, and it worked :NM_peepoShrugSmile:, so i don't know how i assigned them
If you use something like an event folder
And like storing the cache in a map or collections in Discord.js, which is the same thing as Map
You must ensure that the value is assigned before receiving the customer when loading the events
Because the client that was exported to the events may be without client.moon!
@Justin
All values ββmust be assigned before playing on the Discord.js map or collections
Summed up:
When you add a class to a Map object and then add a new function to the class, that function will not automatically be reflected in Map objects that have already been created using that class. This is because Map objects store a reference to the class that was used when they were created, and any subsequent changes to the class do not affect existing Map objects.
unwilling-turquoiseOPβ’2y ago
Different question now, is it possible to change the messages of Moonlink.js?
Like this?
I didn't understand what you meant
other-emeraldβ’2y ago
HAHA
π π π π
ASK CHATGPT
You speak something random that I don't quite understand
other-emeraldβ’2y ago
WDYMMM
It's pretty clear
Moonlink.js issues with gpt are very flawed
other-emeraldβ’2y ago
No
Bruh
Okay
afraid-scarletβ’2y ago
When you guys mean change messages what messages?
other-emeraldβ’2y ago
he wants to change the messages from the moonlink.js
ill show u
other-emeraldβ’2y ago

afraid-scarletβ’2y ago
Yah we must be able to edit that
If thats pos
Just edit the content
It's the basics of Discord.js
afraid-scarletβ’2y ago
Cool thanks :)
?play disfruto
you are not on a voice channel
other-emeraldβ’2y ago
in our thread π
I messed up the chat
Ksksk
I was doing a test
@Jul πΉ Did you manage to fix it?
other-emeraldβ’2y ago
no
If you want me to review the codes, I can take a look and fix the problem
other-emeraldβ’2y ago
does @Blobit - Moonlink.js do mp3 urls?
Yes, accept
moonlink.js is integrated directly into it
other-emeraldβ’2y ago

<:Nota_Musica__Mlink:960665601574055966>βΊβΈ
Title:
<:Estrela_Mlink:960660485999587348>βΊβΈ
Uri:
<:emoji_21:967836966714503168>βΊβΈ
Author:
XenoFM
<:emoji_23:967837516558393365>βΊβΈ
Duration:
-2 Days, -12 Hours, -21 Minutes, -488 Seconds
Request for: aqhe
XenoFM. is playing now [ time test result: 323ms ]
other-emeraldβ’2y ago
can u force disconnect it?
like
not via command
other-emeraldβ’2y ago

other-emeraldβ’2y ago
like that
as musicas acabaram
other-emeraldβ’2y ago
what
I disconnected it
other-emeraldβ’2y ago
via command
?play https://stream.xenofm.live/listen/xenofm/quality/high

<:Nota_Musica__Mlink:960665601574055966>βΊβΈ
Title:
<:Estrela_Mlink:960660485999587348>βΊβΈ
Uri:
<:emoji_21:967836966714503168>βΊβΈ
Author:
XenoFM
<:emoji_23:967837516558393365>βΊβΈ
Duration:
-2 Days, -12 Hours, -21 Minutes, -488 Seconds
Request for: aqhe
XenoFM. is playing now [ time test result: 309ms ]
other-emeraldβ’2y ago
why does yours work
but not ours
It was on Discord
other-emeraldβ’2y ago
ours doesnt join back
I went to his profile and disconnected
other-emeraldβ’2y ago
good
As I said, moonlink.js has parameters for this, but strangely it doesn't work on yours
other-emeraldβ’2y ago
no clue why
If you want I can review, I have free time until 12pm - BR
other-emeraldβ’2y ago
br
GG @Jul πΉ, you just advanced to level 2!
Brazil
other-emeraldβ’2y ago
ok
thats 3 hrs?
It's 8:13 am
Yes, I got a problem
other-emeraldβ’2y ago
?
It was in moonlink.js when I found it and fixed it
other-emeraldβ’2y ago
wdym
our problem?
It was very simple, and the players were still playing, but I didn't put the correct If
other-emeraldβ’2y ago
oki
so when we update our package it will work?
we deserve bughunter role now
It depends if the error is not external
other-emeraldβ’2y ago
As I explained to @justin
The error in events
And why don't you assign the values ββbefore launching Collection(discord.js) or map
other-emeraldβ’2y ago
not my fault haha
After it is played there they do not receive updates on the new parameters
other-emeraldβ’2y ago
@Justin baba grill
listen to big man Lucas
In my language this sounds like irony
other-emeraldβ’2y ago
it is
ur a goat tho
without u the package wouldn't be there so don't take offense :D
:Sk
other-emeraldβ’2y ago

Like it or not, it offends
other-emeraldβ’2y ago
what was offending
I don't accept this kind of thing
other-emeraldβ’2y ago
i didnt mean it offensive?
i said listen to big man Lucas
Here you said I'm a goat
other-emeraldβ’2y ago
yeah
do you know what is a goat?
not the animal dum dum
goat: abbreviation for Greatest Of All Time: used to refer to or describe the person who has performed better than anyone else ever
In my translation it means that it is an animal, be more specific when you say it or else I will confuse things
other-emeraldβ’2y ago
yes in here it is also an animal
but we are in the metaverse
in the metaverse we use online words and short forms
like
GOAT
unwilling-turquoiseOPβ’2y ago
Entire different question right now. Is it possible to lower the volume of the audio/music (whatever is playing) of the discord bot? Like setting the volume to 50% or something like that.
Yes
With
unwilling-turquoiseOPβ’2y ago
TypeError: player.volume is not a function
?You implemented it incorrectly
unwilling-turquoiseOPβ’2y ago
Huh, I did?
If you don't define player it won't work
unwilling-turquoiseOPβ’2y ago
Should be implemented right, this is my code; https://sourceb.in/0yhUYPDBHq
And yes, I defined player.
Keyboard changed is setVolume
unwilling-turquoiseOPβ’2y ago
ah so it's
player.setVolume(boolean)
?other-emeraldβ’2y ago
yes
unwilling-turquoiseOPβ’2y ago
Different question @1Lucas1.apk. Is it possible to apply filters to the music? Like making the music bass boosted or something like that?
GitHub
moonlink.js/src/@Rest/MoonlinkFilters.ts at v2 Β· 1Lucas1apk/moonlin...
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. Support Server: https://discord.gg/xQq2A8vku3 - 1Lucas1...
Yes