I’m trying to create a simple discord bot, currently using nodeJS. I’m creating specific commands that only specific users can use and whenever someone who does not have permission to use such command can get a reply “You don’t have permission”. (I hope you get the idea. sorry for the bad wording). This is my current code: But what happens
Tag: discord.js
Inconsistent error when checking for user ID’s while using partials as well. (Discord.js)
The code below is the code I am using to track deleted and edited messages. However, when I try to check the user ID (because sometimes, discord bots like groovy constantly delete and edit messages …
JavaScript,Discord.js, Node.js TypeError: Cannot read property ‘execute’ of undefined
I’m building a discord bot and I want to save information in bdays.json but this error pops up. All other commands are working just fine but I am getting this error: TypeError: Cannot read property ‘execute’ of undefined What should I do? main.js and remeber.js What should I do? Answer You have a typo in your code… In remeber.js you
How to have a Discord bot return the number of words in a message
This is the part that is relevant to the question. If you message the bot “Here are my arguments what do you think about that?”, I want it to return: I need to figure out the command that counts the number of words in a sentence and change this: message.channel.send(`Arguments: ${}`); I’m not familiar with Discord.js functions and which one
discord.js eval command returning [object Map] and [object Object]
so I have my eval command, however when I run such things as an eval to set status or something like that, it returns either [object Object] or [object Map]. I have fixed the previous error with [object Promise], however Object and Map still occur. My code is below, if someone knows how to fix this that would be amazing.
Reason after blacklisting command Discord.js
I want to add a reason to my blacklists (with the command !blacklist {userid} {reason}) which are visible in the embeds below like .addField (“💬 Reason:”, somecode) how can I fix this? Answer First you’ll want to check if there is no reason, this can be simple done by checking, for both approaches, if the second argument is undefined, like
discord.js problem: How can I implement a command that will only allow people with the kick and administrator permission to use the command
I used this command for kicks, but everyone in the server can now kick. I just want to add something that will only allow people with the admin and kick permissions to use it. Answer You have to implement something like at the beginning of your kick command code.
guildMemberAdd and guildMemberRemove Embeds not sending anymore (Discord.js)
I’m very confused about this because they were once working, but now I don’t even get any error messages. Here’s the code: (Welcome Embed) (Goodbye Embed) Screenshot of it working: I also have a guildCreate and guildRemove underneath it as well, but I don’t know if that’s the reason why. Answer The issue is most likely Discord API’s relatively new
I am trying to make a discord.js command that creates a role named “MUTED” and overwrites all the channel permission to set “Send message” to false [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I want to make it so that it creates the role and then overwrites the permissions in every channel that exists in the server. Answer
Discord Intents discord.js
I am trying to use this – I am experiencing issues. See the attached image. Anyone know what wrong? Thanks! Answer You haven’t defined the Intents it –