Every time I try to do that, the emoji just changes into a question mark. Here’s my code: Answer Your message variable in the above code is inconsistent. You used ‘msg’ to catch the return value but used ‘message’ to react. Keep it consistent, otherwise, you might face errors. Also, a bot cannot change the nickname of the owner of
Tag: discord.js
Discord.JS How to wait for member reaction
I am making bot to manage my multiple Discord guilds. And I’d like to make confirmation system, like: User does X thing, Bot sends message in sufficient channel, Bot waits for user to react with :thumbdsup: or :thumbsdown: up to 60 seconds If thumbs up, do A, else – do B. If time is up, do C action How can
Discord.js v12 Ban Command
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
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
Discordjs add space between prefix and command
I created a music bot that streams music when someone taps !play in-text channel Now I want to switch !play with please play but it response only with pleaseplay with no space between them and when I tried to change the code: but it doesn’t work at all with an error log (node:5296) UnhandledPromiseRejectionWarning: Error: No video id found: Answer
How can I send a Discord Direct Message to all users on a server on API v12?
I’m trying to update my discord bot from API v11 to API v12, and I’m having problems to send a direct message to all server users. It is not returning any error and I’m using the latest version from Discord API This is the function: Could someone help me? Answer First of all, depending on the size of the server,
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 setting permission on channel to “/” (neutral)
I am looking to set user permissions on a text channel to neutral/null/”/” but overwritePermissions() seems to only use allow and deny currently, a past post I saw showed setting the value to null but allow/deny seems to prevent that. I am setting permissions on a text channel like this: and would like to effectively undo this action, changing the
How to get if a specific user is online?
I’ve got some code which should send in the current status of a user if they switched to online, but the problem is that it sends the message twice AND that I can’t check who the user who changed their status is. I just want it to check IF the user who changed their status is a person with a
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