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,
Tag: discord.js
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,
Read file on Discord from Dropbox location using JavaScript
I’m currently working on getting a Discord bot to connect to a directory inside of Dropbox, I’m using Discord.js and the Dropbox JavaScript SDK and I’ve done the following: And I get the following response data: But I’m unsure of how to proceed with this data, do I need to convert the content hash back to a json file? Or
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
How can I make the avatar appear in large format?
I’m new to all this, sorry for my stupidity :c is my first discord bot! when I give the command !avatar on discord, the avatar comes out very small on the right of the embed Answer Thumbnails are small. You would need to place the avatar in .setImage() then have it set to scale up to 256 in size This
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
Discord.js Bulk Delete command
I am trying to add a bulk delete command to my bot but when I type how many messages I want to delete, I get the following error: Here’s the code: Answer To use the parseInt(), you have to add the decimal base, so 10 -> parseInt(args[0], 10);. The snippet of code I have put above is working well.
(Discord.js) TypeError: Cannot read property ‘add’ of undefined
So here’s the code: When I run the bot, I get the error: As seen on the code, I add the part where the bot would make a role as when the role is unavailable. But still, it thinks as that the role never exist. Before this was copied, I aslo wrote the code like this: And the result is