Rell
Rell
Lavashark to Moonlink
how do i add spotify to the manager cause wtf
17 replies
Lavashark to Moonlink
im trying to retrieve the current song artwork
17 replies
Lavashark to Moonlink
@1Lucas1.apk TypeError: Cannot read properties of undefined (reading 'artworkUrl')
17 replies
Lavashark to Moonlink
oh okay i see
17 replies
Lavashark to Moonlink
@1Lucas1.apk in my play command or when i initialize the bot
17 replies
Lavashark to Moonlink
thank you very much, I fixed my own problem but now the bot won't connect to the voice channel and play the song.
17 replies
Lavashark to Moonlink
case "play": {
if (!voiceChannel) {
return interaction.editReply({
content: "You need to be in a voice channel!",
ephemeral: true,
});
}

const query = interaction.options.getString("query");
if (!query || typeof query !== "string") {
return interaction.editReply({
content: "Please specify a valid song name or URL to play.",
ephemeral: true,
});
}

console.log("Query:", query); // Debugging

const player = client.manager.createPlayer({
guildId: guild.id,
voiceChannelId: voiceChannel.id,
textChannelId: interaction.channel.id,
autoPlay: true,
});

player.connect();

try {
const result = await client.manager.search(query, interaction.user);
if (!result || !result.tracks || !result.tracks.length) {
return interaction.editReply({
content: "No results found for your query.",
ephemeral: true,
});
}

player.queue.add(result.tracks[0]);
if (!player.playing) player.play();

return interaction.editReply({
content: `Added to queue: **${result.tracks[0].title}**`,
});
} catch (error) {
console.error("Error during search:", error);
return interaction.editReply({
content: "An error occurred while searching for the song.",
ephemeral: true,
});
}
}
case "play": {
if (!voiceChannel) {
return interaction.editReply({
content: "You need to be in a voice channel!",
ephemeral: true,
});
}

const query = interaction.options.getString("query");
if (!query || typeof query !== "string") {
return interaction.editReply({
content: "Please specify a valid song name or URL to play.",
ephemeral: true,
});
}

console.log("Query:", query); // Debugging

const player = client.manager.createPlayer({
guildId: guild.id,
voiceChannelId: voiceChannel.id,
textChannelId: interaction.channel.id,
autoPlay: true,
});

player.connect();

try {
const result = await client.manager.search(query, interaction.user);
if (!result || !result.tracks || !result.tracks.length) {
return interaction.editReply({
content: "No results found for your query.",
ephemeral: true,
});
}

player.queue.add(result.tracks[0]);
if (!player.playing) player.play();

return interaction.editReply({
content: `Added to queue: **${result.tracks[0].title}**`,
});
} catch (error) {
console.error("Error during search:", error);
return interaction.editReply({
content: "An error occurred while searching for the song.",
ephemeral: true,
});
}
}
17 replies
Lavashark to Moonlink
i still need help!
17 replies