Missing Access for Slash Commands

Issue Heres the error message: PS C:\Users\User\Documents\Discord Bot> node . ready C:\Users\User\Documents\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:154 throw new DiscordAPIError(request.path, data, request.method, res.status); ^ DiscordAPIError: Missing Access at RequestHandler.execute (C:\Users\User\Documents\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:154:13) at processTicksAndRejections (node:internal/process/task_queues:93:5) at async RequestHandler.push (C:\Users\User\Documents\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:39:14) { method: ‘post’, path: ‘/applications/723863781607997451/guilds/722043668730740788/commands’,

Continue reading

Get all users in voice channels with discord.js

Issue I’m trying to get the list of users in voice channel : client.on("messageCreate", message => { if (message.author.bot) return false; if (message.content.toLowerCase() == "test") { console.log( message.guild.members.cache.filter(member => member.presence == "online")); }; I’m note sure if guild.members.cache is the

Continue reading

Error: ENOENT: no such file or directory, scandir './commands/'

Issue i am getting this error output, when i want to use discord: Error: ENOENT: no such file or directory, scandir ‘./commands/’ ←[90m at Object.readdirSync (fs.js:1021:3)←[39m at Object.<anonymous> (C:\Users\DAA23\OneDrive\Desktop\bot\main.js:11:25) ←[90m at Module._compile (internal/modules/cjs/loader.js:1063:30)←[39m ←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m ←[90m at Module.load

Continue reading

messagecreate dont working with discord.js

Issue i don’t know why but my code dont work without any error: const Discord = require("discord.js"); const client = new Discord.Client({ intents: [ ‘DIRECT_MESSAGES’, ‘GUILD_MESSAGES’ ] }); client.on("ready", () => { console.log("ready"); }); client.on("messageCreate", (message) => { if (message.content.endsWith("quoi"))

Continue reading

How to find member by username?

Issue Discord.js 13.6.0 | Node.js 16.14.2 I want to find member by username, same as in bot UnbelievaBoat (https://i.stack.imgur.com/WNPv5.png) Example: username is WorldGod Type e.g. ?userinfo worl or ?userinfo WORLD and bot find member WorldGod Code example: const arg =

Continue reading

Discord.js – How to change style of Button

Issue This is how I create and send the button: client.on(‘messageCreate’, (message) => { /* … Checking Command … */ const actionRow = new MessageActionRow().addComponents( new MessageButton() .setStyle("PRIMARY") .setLabel("X") .setCustomId("test")); message.channel.send({ content: "Test", components: [actionRow] }); } A blue Button

Continue reading

How can I fetch Clash Of Clans API?

Issue I’m trying to do a discord bot with the clash of clans api. But I get a weird error message. Thanks Error Message: <?xml version="1.0" encoding="UTF-8"?> <Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>v1/clans/LYVVC9JQQ</Key><RequestId>67H6BCRSJ41W6K6X</RequestId><HostId>mPhpqkXy1qKENdOnt+CPhfQn4rK0hGhaMxaLq9q21Ehtbs/CMzSgqHy9TA6L7hii0PY9+Lo2rzg=</HostId></Error> async function getClashofClansAPi() { let clashofClansAPI =

Continue reading

Editing a Select Menu | Discord.js

Issue I’m trying to get all the text channel in the guild and list them into a Select Menu and I’m getting some trouble. Here is my code : const { PermissionOverwrites, Permissions, Collection, MessageEmbed, MessageActionRow, MessageSelectMenu } = require("discord.js");

Continue reading

Message Collector first Message

Issue I’m using thecreateMessageCollector. It is collecting messages, but the problem is, that it is not getting the first message sent in the channel. const filter = m => m.content.toLowerCase() === message.content.toLowerCase(); const collector = message.channel.createMessageCollector(filter, { max: 1, time:

Continue reading