I made a ban command for my discord.js v12 bot. However whenever I run the command I get an error. Here is my code: This is the error I get whenever I run the command I could’nt understand how to correct the problem in the code. I’m a bit new to coding. Can you please help me out!. Thanks in
Tag: discord
TypeError: Cannot read property ‘awaitMessages’ of null When it is the same as the others
Code: I really have no idea what’s wrong with this as I was completely fine until I added that bit. Not sure why. Anyone got any ideas? Answer You defined person as the message.author.send function. And then you called the send() function on person. That’s like writing: What you should do instead: Circling back, the reason you got the error
How to make Discord Bot make sure your pinging someone in a command
I’m trying to make the bot say the name of someone I pinged and give that person a role. Right now, if you don’t ping someone, the whole bot breaks. Here is my code: Answer I see a few problems with your code: First of all, else if() will always return an error. Second of all, you should switch this
Discord JS add role by reaction command doesn’t work after restart
I’m trying to make a “add role by reaction” command. So when a member reacts to a specific message, the member gets a role. It actually works but when I restart my bot, it doesn’t add a role anymore. Can anyone help? here the code: Answer To make your bot check if previous messages have been reacted upon you could
Discord bot only replying to initator
I am starting with a new Discord bot using discord.js. I am still learning things but am curious if it is possible to send a reply to only the initiator, not the channel. Channel.send and message.reply are both public to all. Answer To dm the person who said the message do To send it to someone else,
What does Message.fetch() actually do in discord.js
According to the Message#fetch() docs, this function simply fetches the message it was called on. However, I’m not sure in which circumstance it would ever make sense to use this function. According to the screenshot above, this method returns Promise<Message>. I’m confused, because why would you need to fetch a message you already have access to? For example: So, what’s
Why is awaiting a reaction isnt working Discord.js V12
I tried to make a confirmation system by awaiting a reaction from this user, for some reason, I can’t get it to work. Here is the code: If anyone could help, it would be great! Thanks. Answer I was reviewing your code and I think I fixed it since I have tried this and it worked as expected. The explanation
How to add permissions to user to channel by command? Discord.js
How to give permissions to a specific channel by command? Sorry, I’m new at discord.js so any help would be appreciated. Answer You can use GuildChannel.updateOverwrites() to update the permissions on a channel. (From example in the discord.js docs) Using this function, you can provide a User or Role Object or ID of which to update permissions (in your case,
messageReactionAdd event doesn’t word anymore without explanation
I’m working on a discord bot which adds the role “Voteur” when a user reacts on a embed message created by the bot. Until today it has worked great, but I don’t know why doesn’t word anymore. The bot creates the embed message and add the reactions but nothing happens when a user reacts! Are there any changes that I
I’m having an issue with adding an “Auto-Moderating” feature on my Discord bot
G’day, I really need some help with the “Auto-Moderation” feature that I want to include in my very first Discord Bot, which is coded in JavaScript. Also, I am really new to this programming language and the discord.js itself, so I don’t really know how to use all the arguments properly. Whatever, the point is, I want my bot to