Skip to content
Advertisement

Tag: discord.js

Discord.Intents(32767) vs [Intents.FLAGS.GUILDS]?

Do you know why the “message sent” is displayed only with the first solution? And not with this? (That is the example code on the discord.js documentation.) The bot is ready in both solutions, but I don’t get why only in the first one when I send a message in the server the bot detects it, maybe because I don’t

Remove 1 element from Embed object DiscordJS

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

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

Advertisement