HewkawAr
HewkawAr
Explore posts from servers
MIA🎄 Moonlink.js - Imagine a Music Application
Created by HewkawAr on 7/24/2024 in #issues
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
I have 2 problems 1. My bot is connected to Lavalink but don't log in console like
[0] "HStudio - BKK" was connected.
[0] "HStudio - BKK" was connected.
2. When I search it error log in console
D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\moonlink.js\dist\src\core\Manager.js:51
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
^

TypeError: Cannot read properties of null (reading 'tracks')
at D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\moonlink.js\dist\src\core\Manager.js:51:35
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v22.2.0
D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\moonlink.js\dist\src\core\Manager.js:51
let tracks = req.data.tracks.map((data) => new index_1.Track(data, requester));
^

TypeError: Cannot read properties of null (reading 'tracks')
at D:\.Projects\HewkawDiscordBotProject\HStudio\node_modules\moonlink.js\dist\src\core\Manager.js:51:35
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v22.2.0
Search Code
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
});
Full Code: https://github.com/HStudioDiscordBot/HStudioSource/tree/Bump-moonlink.js-from-3.6.64-to-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
Version - [email protected] - Node.js v18.13.0 My Simple Code
const { default: axios } = require("axios");

module.exports = {
name: 'interactionCreate',
async execute(interaction, client) {
const role = await interaction.guild.roles.cache.get("1181943769789108255");
await interaction.member.roles.add(role);
await interaction.reply("Hello");
}
const { default: axios } = require("axios");

module.exports = {
name: 'interactionCreate',
async execute(interaction, client) {
const role = await interaction.guild.roles.cache.get("1181943769789108255");
await interaction.member.roles.add(role);
await interaction.reply("Hello");
}
Console
DiscordAPIError[50013]: Missing Permissions
at handleErrors (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:1120:23)
at async SequentialHandler.queueRequest (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:953:14)
at async _REST.request (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async GuildMemberRoleManager.add (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:131:7)
at async Object.execute (D:\.Projects\HewkawDiscordBotProject\M2Bot\events\interactionCreateButtons.js:8:13)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: { files: undefined, json: undefined },
rawError: { message: 'Missing Permissions', code: 50013 },
code: 50013,
status: 403,
method: 'PUT',
url: 'https://discord.com/api/v10/guilds/1121829832423129160/members/758681611251744788/roles/1181943769789108255'
}

Node.js v18.13.0
DiscordAPIError[50013]: Missing Permissions
at handleErrors (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:1120:23)
at async SequentialHandler.queueRequest (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:953:14)
at async _REST.request (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async GuildMemberRoleManager.add (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:131:7)
at async Object.execute (D:\.Projects\HewkawDiscordBotProject\M2Bot\events\interactionCreateButtons.js:8:13)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: { files: undefined, json: undefined },
rawError: { message: 'Missing Permissions', code: 50013 },
code: 50013,
status: 403,
method: 'PUT',
url: 'https://discord.com/api/v10/guilds/1121829832423129160/members/758681611251744788/roles/1181943769789108255'
}

Node.js v18.13.0
6 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 Simple Code
const { EmbedBuilder, ButtonStyle, ActionRowBuilder, ButtonBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } = require("discord.js");
const { default: axios } = require("axios");

module.exports = {
name: 'interactionCreate',
async execute(interaction, client) {
const role = await interaction.guild.roles.cache.get("1181943769789108255");
await interaction.member.roles.add(role);
await interaction.reply("Hello");
}
const { EmbedBuilder, ButtonStyle, ActionRowBuilder, ButtonBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } = require("discord.js");
const { default: axios } = require("axios");

module.exports = {
name: 'interactionCreate',
async execute(interaction, client) {
const role = await interaction.guild.roles.cache.get("1181943769789108255");
await interaction.member.roles.add(role);
await interaction.reply("Hello");
}
DiscordAPIError[50013]: Missing Permissions
at handleErrors (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:1120:23)
at async SequentialHandler.queueRequest (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:953:14)
at async _REST.request (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async GuildMemberRoleManager.add (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:131:7)
at async Object.execute (D:\.Projects\HewkawDiscordBotProject\M2Bot\events\interactionCreateButtons.js:23:13)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: { files: undefined, json: undefined },
rawError: { message: 'Missing Permissions', code: 50013 },
code: 50013,
status: 403,
method: 'PUT',
url: 'https://discord.com/api/v10/guilds/1121829832423129160/members/758681611251744788/roles/1181943769789108255'
}

Node.js v18.13.0
DiscordAPIError[50013]: Missing Permissions
at handleErrors (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:1120:23)
at async SequentialHandler.queueRequest (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:953:14)
at async _REST.request (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async GuildMemberRoleManager.add (D:\.Projects\HewkawDiscordBotProject\M2Bot\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:131:7)
at async Object.execute (D:\.Projects\HewkawDiscordBotProject\M2Bot\events\interactionCreateButtons.js:23:13)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: { files: undefined, json: undefined },
rawError: { message: 'Missing Permissions', code: 50013 },
code: 50013,
status: 403,
method: 'PUT',
url: 'https://discord.com/api/v10/guilds/1121829832423129160/members/758681611251744788/roles/1181943769789108255'
}

Node.js v18.13.0
2 replies