Skip : Error

[ERROR] => TypeError: this.queue.all is not a function
9 Replies
KevinSidd
KevinSiddOP•10mo ago
const { Colors, ApplicationCommandOptionType } = require("discord.js");
const { Command } = require("../../../handlers/helpers/command");
const { createEmbeds } = require("../../../handlers/helpers/embed");
const { MoonlinkPlayer } = require("moonlink.js");

module.exports = new Command({
name: "skip",
description: "Skip the current song or to",
category: "Music",
options: [{
type: ApplicationCommandOptionType.Integer,
name: "number",
description: "The number of songs to skip.",
required: false
}],
runSlash: async (client, interaction) => {
if (!client.moonReady) return;

/**@type {MoonlinkPlayer} */
const player = client.manager.players.get(interaction.guild.id);
if (!player) {
return interaction.reply({
content: "There is no player for this guild.",
ephemeral: true
});
}

const voiceChannel = interaction.member.voice.channel;
if (!voiceChannel) {
return interaction.reply({
content: "You need to be in a voice channel to use this command.",
ephemeral: true
});
}

if (voiceChannel.id !== player.voiceChannel) {
return interaction.reply({
content: "You need to be in the same voice channel as the player to use this command.",
ephemeral: true
});
}

const number = interaction.options.getInteger("number") || 1;
if (number > player.queue.size) {
return interaction.reply({
content: "There are not that many songs in the queue.",
ephemeral: true
});
}

player.skip(number);

return interaction.reply({
embeds: createEmbeds([{
AuthorIcon: "https://cdn.discordapp.com/emojis/1244001599005786193.gif?size=128&quality=lossless",
AuthorName: "Mitthu Music",
Description: `> **Skipped** ${number} song${number > 1 ? "s" : ""} as requested by <@${interaction.user.id}>`,
Color: Colors.Green
}])
});
}
})
const { Colors, ApplicationCommandOptionType } = require("discord.js");
const { Command } = require("../../../handlers/helpers/command");
const { createEmbeds } = require("../../../handlers/helpers/embed");
const { MoonlinkPlayer } = require("moonlink.js");

module.exports = new Command({
name: "skip",
description: "Skip the current song or to",
category: "Music",
options: [{
type: ApplicationCommandOptionType.Integer,
name: "number",
description: "The number of songs to skip.",
required: false
}],
runSlash: async (client, interaction) => {
if (!client.moonReady) return;

/**@type {MoonlinkPlayer} */
const player = client.manager.players.get(interaction.guild.id);
if (!player) {
return interaction.reply({
content: "There is no player for this guild.",
ephemeral: true
});
}

const voiceChannel = interaction.member.voice.channel;
if (!voiceChannel) {
return interaction.reply({
content: "You need to be in a voice channel to use this command.",
ephemeral: true
});
}

if (voiceChannel.id !== player.voiceChannel) {
return interaction.reply({
content: "You need to be in the same voice channel as the player to use this command.",
ephemeral: true
});
}

const number = interaction.options.getInteger("number") || 1;
if (number > player.queue.size) {
return interaction.reply({
content: "There are not that many songs in the queue.",
ephemeral: true
});
}

player.skip(number);

return interaction.reply({
embeds: createEmbeds([{
AuthorIcon: "https://cdn.discordapp.com/emojis/1244001599005786193.gif?size=128&quality=lossless",
AuthorName: "Mitthu Music",
Description: `> **Skipped** ${number} song${number > 1 ? "s" : ""} as requested by <@${interaction.user.id}>`,
Color: Colors.Green
}])
});
}
})
MEE6
MEE6•10mo ago
GG @KevinSidd, you just advanced to level 2!
KevinSidd
KevinSiddOP•10mo ago
Please LMK if I am doing something wrong!
1Lucas1.apk
1Lucas1.apk•10mo ago
be Would you be able to show the complete error of its origin?
KevinSidd
KevinSiddOP•10mo ago
Currently not on laptop will share whole when back!
1Lucas1.apk
1Lucas1.apk•10mo ago
okay, I'll wait 🙂
KevinSidd
KevinSiddOP•10mo ago
[ERROR] => TypeError: this.queue.all is not a function
at MoonlinkPlayer.skip (C:\Users\Kevin\Desktop\Code\Discord Bots\Mitthu\node_modules\moonlink.js\dist\src\@Entities\MoonlinkPlayer.js:251:36)
at Command.runSlash (C:\Users\Kevin\Desktop\Code\Discord Bots\Mitthu\src\commands\chatInput\music\skip.js:51:16)
at C:\Users\Kevin\Desktop\Code\Discord Bots\Mitthu\src\events\interactionCreate\handleCommands.js:89:29
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.run (C:\Users\Kevin\Desktop\Code\Discord Bots\Mitthu\src\events\interactionCreate\handleCommands.js:88:17)
[ERROR] => TypeError: this.queue.all is not a function
at MoonlinkPlayer.skip (C:\Users\Kevin\Desktop\Code\Discord Bots\Mitthu\node_modules\moonlink.js\dist\src\@Entities\MoonlinkPlayer.js:251:36)
at Command.runSlash (C:\Users\Kevin\Desktop\Code\Discord Bots\Mitthu\src\commands\chatInput\music\skip.js:51:16)
at C:\Users\Kevin\Desktop\Code\Discord Bots\Mitthu\src\events\interactionCreate\handleCommands.js:89:29
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.run (C:\Users\Kevin\Desktop\Code\Discord Bots\Mitthu\src\events\interactionCreate\handleCommands.js:88:17)
If you looking for this :Namaste2_BG:
1Lucas1.apk
1Lucas1.apk•10mo ago
Thanks for reporting I will fix the problem a new version has been published fixing your problem
KevinSidd
KevinSiddOP•10mo ago
Thank you man will work on tomorrow It's midnight Gn

Did you find this page helpful?