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?
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.
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
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
Ah, thanks. Please mention me when the version has been released π
He is well
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
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?
v18.18.0
genetic-orangeβ’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
genetic-orangeβ’2y ago
Ok cool no worries, thought I would ask about that.
Now I want to understand why the playerDisconnected is not being issued
genetic-orangeβ’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
foreign-sapphireβ’2y ago
(i am the leader of this project)
do we try this?
Could you test this code?
genetic-orangeβ’2y ago
Cool it works
Have a great day π
genetic-orangeβ’2y ago
Would this work away from client.on? so creating its own file?
Basically an 'external file'
genetic-orangeβ’2y ago
Just cause we are facing an err when trying it.
foreign-sapphireβ’2y ago
ye
Cause this is my external file,
And then it returns with
TypeError: Cannot read properties of undefined (reading 'player')
foreign-sapphireβ’2y ago
that's probably because moon is not defined
foreign-sapphireβ’2y ago
you copied our code, congrats
genetic-orangeβ’2y ago
Yes, if we do that its sending any err don't worry :)
GG @Connor200024, you just advanced to level 1!
genetic-orangeβ’2y ago
I will figure this out :D
thanks for the fix and letting us know the issue.
Have a great day π
genetic-orangeβ’2y ago
Same to you :)
foreign-sapphireβ’2y ago
π
π
π
π
π€‘
genetic-orangeβ’2y ago
Cool guy Lucas is ;)
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
foreign-sapphireβ’2y ago
it imports the client
GG @Jul πΉ, you just advanced to level 1!
It keeps giving me this error,
TypeError: Cannot read properties of undefined (reading 'players')
foreign-sapphireβ’2y ago
it cant find client.moon.player or players
See what returns from client.moon
alright one sec
GG @Justin, you just advanced to level 2!
undefined
See if the client returns
client returns
How do you assign moonlink.js to client.moon?
π€‘
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.
Different question now, is it possible to change the messages of Moonlink.js?
Like this?
I didn't understand what you meant
foreign-sapphireβ’2y ago
HAHA
π π π π
ASK CHATGPT
You speak something random that I don't quite understand
foreign-sapphireβ’2y ago
WDYMMM
It's pretty clear
Moonlink.js issues with gpt are very flawed
foreign-sapphireβ’2y ago
No
Bruh
Okay
genetic-orangeβ’2y ago
When you guys mean change messages what messages?
foreign-sapphireβ’2y ago
he wants to change the messages from the moonlink.js
ill show u
foreign-sapphireβ’2y ago

genetic-orangeβ’2y ago
Yah we must be able to edit that
If thats pos
Just edit the content
It's the basics of Discord.js
genetic-orangeβ’2y ago
Cool thanks :)
?play disfruto
you are not on a voice channel
foreign-sapphireβ’2y ago
in our thread π
I messed up the chat
Ksksk
I was doing a test
@Jul πΉ Did you manage to fix it?
foreign-sapphireβ’2y ago
no
If you want me to review the codes, I can take a look and fix the problem
foreign-sapphireβ’2y ago
does @Blobit - Moonlink.js do mp3 urls?
Yes, accept
moonlink.js is integrated directly into it
foreign-sapphireβ’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 ]
foreign-sapphireβ’2y ago
can u force disconnect it?
like
not via command
foreign-sapphireβ’2y ago

foreign-sapphireβ’2y ago
like that
as musicas acabaram
foreign-sapphireβ’2y ago
what
I disconnected it
foreign-sapphireβ’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 ]
foreign-sapphireβ’2y ago
why does yours work
but not ours
It was on Discord
foreign-sapphireβ’2y ago
ours doesnt join back
I went to his profile and disconnected
foreign-sapphireβ’2y ago
good
As I said, moonlink.js has parameters for this, but strangely it doesn't work on yours
foreign-sapphireβ’2y ago
no clue why
If you want I can review, I have free time until 12pm - BR
foreign-sapphireβ’2y ago
br
GG @Jul πΉ, you just advanced to level 2!
Brazil
foreign-sapphireβ’2y ago
ok
thats 3 hrs?
It's 8:13 am
Yes, I got a problem
foreign-sapphireβ’2y ago
?
It was in moonlink.js when I found it and fixed it
foreign-sapphireβ’2y ago
wdym
our problem?
It was very simple, and the players were still playing, but I didn't put the correct If
foreign-sapphireβ’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
foreign-sapphireβ’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
foreign-sapphireβ’2y ago
not my fault haha
After it is played there they do not receive updates on the new parameters
foreign-sapphireβ’2y ago
@Justin baba grill
listen to big man Lucas
In my language this sounds like irony
foreign-sapphireβ’2y ago
it is
ur a goat tho
without u the package wouldn't be there so don't take offense :D
:Sk
foreign-sapphireβ’2y ago

Like it or not, it offends
foreign-sapphireβ’2y ago
what was offending
I don't accept this kind of thing
foreign-sapphireβ’2y ago
i didnt mean it offensive?
i said listen to big man Lucas
Here you said I'm a goat
foreign-sapphireβ’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
foreign-sapphireβ’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
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
TypeError: player.volume is not a function
?You implemented it incorrectly
Huh, I did?
If you don't define player it won't work
Should be implemented right, this is my code; https://sourceb.in/0yhUYPDBHq
And yes, I defined player.
Keyboard changed is setVolume
ah so it's
player.setVolume(boolean)
?foreign-sapphireβ’2y ago
yes
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