HewkawAr
HewkawAr
Explore posts from servers
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
if i found more problem i will tell you
26 replies
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
oh it's looking good
26 replies
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
26 replies
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
const { SlashCommandBuilder, EmbedBuilder, Colors } = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
.setName("leave")
.setDescription("Leave from Voice Channel")
.setDescriptionLocalizations({
th: "ออกจากห้องเสียง"
}),

/**
*
* @param {import("discord.js").CommandInteraction} interaction
* @param {import("discord.js").Client} client
* @param {import("../../class/Locale")} locale
*/
async execute(interaction, client, locale) {
if (!interaction.member.voice.channel) return await interaction.reply({ embeds: [new EmbedBuilder().setColor(Colors.Yellow).setTitle(locale.getLocaleString("command.join.userNotInVoiceChannel"))] });

let player = client.moon.createPlayer({
guildId: interaction.guild.id,
voiceChannelId: interaction.member.voice.channel.id,
textChannelId: interaction.channel.id,
autoLeave: true,
autoPlay: true
});

if (!player.connected) {
return interaction.reply({
embeds: [
new EmbedBuilder()
.setColor(Colors.Red)
.setDescription(locale.getLocaleString("command.leave.botNotInVoiceChannel"))
]
});
}

if (player.destroy()) {
interaction.reply({
embeds: [
new EmbedBuilder()
.setColor(Colors.Red)
.setDescription(locale.getLocaleString("command.leave.leaved"))
]
});
} else {
interaction.reply({
embeds: [
new EmbedBuilder()
.setColor(Colors.Red)
.setDescription(locale.getLocaleString("command.leave.fail"))
]
});
}
}
};
const { SlashCommandBuilder, EmbedBuilder, Colors } = require("discord.js");

module.exports = {
data: new SlashCommandBuilder()
.setName("leave")
.setDescription("Leave from Voice Channel")
.setDescriptionLocalizations({
th: "ออกจากห้องเสียง"
}),

/**
*
* @param {import("discord.js").CommandInteraction} interaction
* @param {import("discord.js").Client} client
* @param {import("../../class/Locale")} locale
*/
async execute(interaction, client, locale) {
if (!interaction.member.voice.channel) return await interaction.reply({ embeds: [new EmbedBuilder().setColor(Colors.Yellow).setTitle(locale.getLocaleString("command.join.userNotInVoiceChannel"))] });

let player = client.moon.createPlayer({
guildId: interaction.guild.id,
voiceChannelId: interaction.member.voice.channel.id,
textChannelId: interaction.channel.id,
autoLeave: true,
autoPlay: true
});

if (!player.connected) {
return interaction.reply({
embeds: [
new EmbedBuilder()
.setColor(Colors.Red)
.setDescription(locale.getLocaleString("command.leave.botNotInVoiceChannel"))
]
});
}

if (player.destroy()) {
interaction.reply({
embeds: [
new EmbedBuilder()
.setColor(Colors.Red)
.setDescription(locale.getLocaleString("command.leave.leaved"))
]
});
} else {
interaction.reply({
embeds: [
new EmbedBuilder()
.setColor(Colors.Red)
.setDescription(locale.getLocaleString("command.leave.fail"))
]
});
}
}
};
26 replies
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
normally i use player.destroy() but now i use but it crash
undefined:1


SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at parseJSONFromBytes (node:internal/deps/undici/undici:4306:19)
at successSteps (node:internal/deps/undici/undici:4288:27)
at consumeBody (node:internal/deps/undici/undici:4294:9)
at _Response.json (node:internal/deps/undici/undici:4239:18)
at D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\moonlink.js\dist\src\Utils.js:12:28
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Rest.destroy (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\moonlink.js\dist\src\entities\Rest.js:46:23)
at async PlayerManager.delete (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\moonlink.js\dist\src\management\PlayerManager.js:43:9)

Node.js v22.2.0
undefined:1


SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at parseJSONFromBytes (node:internal/deps/undici/undici:4306:19)
at successSteps (node:internal/deps/undici/undici:4288:27)
at consumeBody (node:internal/deps/undici/undici:4294:9)
at _Response.json (node:internal/deps/undici/undici:4239:18)
at D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\moonlink.js\dist\src\Utils.js:12:28
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Rest.destroy (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\moonlink.js\dist\src\entities\Rest.js:46:23)
at async PlayerManager.delete (D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\moonlink.js\dist\src\management\PlayerManager.js:43:9)

Node.js v22.2.0
26 replies
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
how to destroy player?
26 replies
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
but i have more problem
26 replies
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
Yeah it work
26 replies
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
If i put song url it can play but when i put song query it send undefined to lavalink but it should send spsearch:you belong with me
let res = await client.moon.search({
query,
source: "spsearch",
requester: interaction.user.id
});
let res = await client.moon.search({
query,
source: "spsearch",
requester: interaction.user.id
});
2024-07-25T21:17:32.973+07:00 INFO 20860 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "undefined:you belong with me"
2024-07-25T21:17:32.973+07:00 INFO 20860 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "undefined:you belong with me"
26 replies
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
ahh why i can't search?
26 replies
MIA⛺ Moonlink.js - Imagine a Music Applicatiom
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
Forgot to mention that I use moonlink.js version 4.0.1
26 replies
DIAdiscord.js - Imagine an app
Created by HewkawAr on 12/12/2023 in #djs-questions
My Bot Can't Add roles to member
My Bot Get Administrator Permission And Intents
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildModeration,
]
});
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildModeration,
]
});
6 replies