Skip : Error
[ERROR] => TypeError: this.queue.all is not a function
9 Replies
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
}])
});
}
})
GG @KevinSidd, you just advanced to level 2!
Please LMK if I am doing something wrong!
be
Would you be able to show the complete error of its origin?
Currently not on laptop will share whole when back!
okay, I'll wait 🙂
[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)
Thanks for reporting I will fix the problem
a new version has been published fixing your problem
Thank you man will work on tomorrow
It's midnight
Gn