Help with some code

So.. when i use client.moon.search(query) and use a url like a youtube url or smth, i get
res.data.map is not a function
res.data.map is not a function
but when i type the title i dont get the error? i dont understand..
42 Replies
MEE6
MEE62y ago
GG @Norby/, you just advanced to level 1!
1Lucas1.apk
1Lucas1.apk2y ago
Hello, the new version of moonlink is being refactored to v4 by lavalink, lavalink developers have published a beta version
foreign-sapphire
foreign-sapphireOP2y ago
yeah i know that, and i'm using it already
other-emerald
other-emerald2y ago
yes me too it would be perfect if it was fixed
1Lucas1.apk
1Lucas1.apk2y ago
Just update the lavalink
1Lucas1.apk
1Lucas1.apk2y ago
I intend to remove all lavalink support below this version, as it is already weighing the code
other-emerald
other-emerald2y ago
but it was already up to date even i deleted it and downloaded it again but the result is the same
MEE6
MEE62y ago
GG @Mèmte, you just advanced to level 1!
other-emerald
other-emerald2y ago
No description
other-emerald
other-emerald2y ago
this problem occurs when url is entered song or playlist url I guess the same was true for the auto play function
optimistic-gold
optimistic-gold2y ago
I do get the same error, and I already use the newest version brother
1Lucas1.apk
1Lucas1.apk2y ago
@deleted_user_f8d2b1e7c3a9 Can you send me the full error to see where it comes from
other-emerald
other-emerald2y ago
<#1126189246445793311>
1Lucas1.apk
1Lucas1.apk2y ago
I wanted complete, this is a superficial part, the error only shows that it comes from search Nowhere is it issued Type can be internal or from bot command
other-emerald
other-emerald2y ago
i guess I didn't quite understand what you meant
1Lucas1.apk
1Lucas1.apk2y ago
All error log It is essential to find the root of the problem If she is us moonlink codes
other-emerald
other-emerald2y ago
👍🏼
1Lucas1.apk
1Lucas1.apk2y ago
It will show step by step where he went I need full error I found the problem guys
1Lucas1.apk
1Lucas1.apk2y ago
No description
1Lucas1.apk
1Lucas1.apk2y ago
Some things have been changed, the next version will be corrected
other-emerald
other-emerald2y ago
okey thanks
exotic-emerald
exotic-emerald2y ago
@1Lucas1.apk How come
bot.manager.search({ query: search }, member.user).then(async (res) => {
res.tracks[0] // IS NOTHING? TypeError: Cannot read properties of undefined (reading '0')
})
bot.manager.search({ query: search }, member.user).then(async (res) => {
res.tracks[0] // IS NOTHING? TypeError: Cannot read properties of undefined (reading '0')
})
So basically if i search for a song using an url i get this error: TypeError: Cannot read properties of undefined (reading '0') And if I try using normal words I get no error and res.tracks[0] is defined all of a sudden Lucas hello? @Mèmte did u find any fix for your issue?
other-emerald
other-emerald2y ago
I am not facing any problem at the moment.
deep-jade
deep-jade2y ago
Try this
const res = bot.manager.search({ query: search}, member.user);

player.queue.add(res.tracks[0])
const res = bot.manager.search({ query: search}, member.user);

player.queue.add(res.tracks[0])
I think it would be like this to add the music in moonlink I'm using the Erela.js fork of Tomato6966 at the moment
MEE6
MEE62y ago
GG @NedcloarBR, you just advanced to level 1!
exotic-emerald
exotic-emerald2y ago
i upgraded everything last night from erela.js and it wasn't to hard. but I dont get why res.tacks[0] is null when a track gets loaded
exotic-emerald
exotic-emerald2y ago
if you want to use erela.js but lavalink v4. I would recommend trying out Magmastream Magmastream is a fork of erela.js which is being mantained and only works atm with lavalink v4 https://github.com/Blackfort-Hosting/magmastream https://docs.blackforthosting.com/introduction/getting-started
GitHub
GitHub - Blackfort-Hosting/magmastream: A user-friendly Lavalink cl...
A user-friendly Lavalink client designed for NodeJS. - GitHub - Blackfort-Hosting/magmastream: A user-friendly Lavalink client designed for NodeJS.
Getting Started
Welcome to Magmastream's documentation! Magmastream is a fork of Erela.Js. This fork is powerfull and contains alot of tweaks.
exotic-emerald
exotic-emerald2y ago
I will also use magmastream simply because the programmers KNOW english and KNOW how to properly name stuff xD
deep-jade
deep-jade2y ago
thx for the suggestion! i'm using this fork at the moment https://github.com/Tomato6966/erela.js
GitHub
GitHub - Tomato6966/erela.js: An up to date Lavalink Wrapper, which...
An up to date Lavalink Wrapper, which makes it easy to use Lavalink within your Discord Bot! - GitHub - Tomato6966/erela.js: An up to date Lavalink Wrapper, which makes it easy to use Lavalink with...
exotic-emerald
exotic-emerald2y ago
Wow, thank you for telling me that. I follwed many tutorials from Tomato but didnt realize he had his own erela.js fork I still want to switch to magmastream tho! Try something new because I am having issues with erela.js atm with joining the voice channel, player state is on playing but no audio is coming through
1Lucas1.apk
1Lucas1.apk2y ago
I did not understand this part :?
deep-jade
deep-jade2y ago
carinha doido mano ksksks
1Lucas1.apk
1Lucas1.apk2y ago
Meu Deus Kk Tou com uma preguiça enorme hoje 🥱
deep-jade
deep-jade2y ago
acontece to querendo terminar umas coisas no meu bot mas a preguiça ta muito forte acho que vou jogar CS ou Vava
1Lucas1.apk
1Lucas1.apk2y ago
Ksk, eu tava tirando umas coisas do código, e nem percebi que já tava no jogo :k Eu acho que já tenho TDH 🤔 Devo ter mesmo
deep-jade
deep-jade2y ago
vai num psicologo pra ele te analizar dai se tu tiver o laudo fica mais facil de dar essa desculpa ksksks
1Lucas1.apk
1Lucas1.apk2y ago
Aqui só tem pisicologo do SUS 😌 Mora no interior tem suas desvantagens, alegria
deep-jade
deep-jade2y ago
1 ano de espera pra cada consulta ksksksk
1Lucas1.apk
1Lucas1.apk2y ago
Imaginei, vamos analisar e o resultado sai em 14 de abril de 2026 Eu fico me perguntando porque o Amazonas não é o mais desenvolvido que os outros demais estados, outros países investem dinheiro pro Amazonas
deep-jade
deep-jade2y ago
só querem os recursos da floresta o pessoal que mora nela que se foda só pode ser assim que pensam
1Lucas1.apk
1Lucas1.apk2y ago
E o que é recebido eu acho que é só benefício pros governadores Porque nunca vi dinheiro salvar queimadas, no máximo quem faz é os bombeiros e ainda são pagos com mesmo salário Bom vou jogar, porque programar eu não consigo hoje mais não ksks

Did you find this page helpful?