I have been trying to code a bot that copies 1 embed from 1 channel to another channel. But what I want it to do before posting it to the other channel, I want it to remove 1 element from the embed object. How I have it currently: As you can see i straight use message.embeds[0]. So i don’t even
Tag: discord
Client.users.fetch returning “Unknown user”
I’m trying to code a discord bot that send a message to all users in a list. I am having problems using the client.users.fetch(); method on discord.js. The error message says something about DiscordAPIError: Unknown user, Unhandled promise rejection, and DiscordAPIError: Cannot send messages to this user, even though I am in the same guild as the bot. Here is
How do I fix CLIENT_MISSING_INTENTS error?
I started learning about discord.js, but now I am facing this issue. I tried some googling, but I couldn’t manage to fix it. This is the error I am getting: Answer You need to specify the events which you want your bot to receive using gateway intents. Instead of const client = new Discord.Client(); Use const client = new Discord.Client({
discord.js Editing a message and sleeping
So I am very new to discord.js and wanted to know how I can edit a message and then sleep and then edit the message again so it doesn’t cause extremely fast edits. I found this code and couldn’t figure out what to do Answer As suggested by LercDsgn in the comments, you can use setTimeout to edit the message
Discord.js | Command Cooldown is set but not working
So the message.js where the cooldown go and help.js is a command, help command is currently set to 60 seconds as can you see at the cooldown but no matter what I input there it doesn’t work and still set to less than 1 second I guess for the output kindly check the GIF included to this question. message.js: help.js
Discord.js ‘presenceUpdate’ not being called
I have a “Special User” which is equal to ‘Client.users.fetch(Special User’s ID)’. Then the user has two event listeners attached to the it, ‘message’ and ‘presenceUpdate’, The message event listener works perfects, although the presenceUpdate does not work at all, All help is greatly appreciated! Answer If the presenceUpdate event doesn’t trigger, chances are you’ll need to add the GUILD_PRESENCES
How to ping message author and user in Discord.js embed
i recently started with Discord.js and i am currently making a hug command. the command itself is working fine, but the problem i am facing is that i want the bot to ping the message author and the user that gets hugged. if i type in the command “a!hug @user” this is what i get: “<@1389615656215> hugged username”, but i
Send message to specific channel (command on module.exports)
So I don’t wanna make a mess out of my Main.js so I try to make every possible command through module.exports in other documents.js Basically I need that if I send a command, the bot will delete my message and post a comment+embed on a specific channel. This is what I have (making it simple): I’ve read another Questions and
How to select random object from JSON file in discord.js
I’ve done some searching around and I found some posts on here but my code doesn’t want to work. Basically I’m making a discord bot and I want to select an object from a JSON file at random. This is my command: And this is my JSON file: If I want put the objects in the command manually and then
Bot isn’t listening to guildMemberAdd
I signed up just a few moments ago because something was really bothering me: I have the following code: For some reason, when I leave and rejoin the server, the embed isn’t sending at all to the channel. I am getting no errors in the console. Any ideas on what may have gone wrong? Thanks. 🙂 Answer You need ‘Server