discord.js - Imagine a πŸ‘»

DIA

discord.js - Imagine a πŸ‘»

Support server for discord.js, a Node.js module to interact with Discord's apps API.

Join

djs-questions

djs-voice

Bot not coming online

My bot does not come online when i run this code ```js const { Client, GatewayIntentBits } = require('discord.js'); require('dotenv/config'); ...

Edit an interaction reply after StringSelectMenu choice

I'm using discord.js@14.10.2. When a button is pressed, I reply to that interaction with a message that contains a String Select Menu. Once a choice is selected from the String Select Menu, I'd like to then update that original message to remove the String Select Menu. I know I'd use components: [], but I'm having trouble editing the reply after selection because once a selection is made, then you have a new interaction, so therefore interaction.editReply doesn't work, because it's trying to edit the reply of the new interaction. Is there a good way to grab the previous interaction and then run the editReply function on it?...

error on handelcomands though i didnt wrote anything there

client.commands.set(command.data.name, command); ^ TypeError: Cannot read properties of undefined (reading 'name')...

Making empheral embeds

I'm having an issue where I am trying to make an embed empheral, I can't seem to get it to work. I am getting a lot of different answers saying it is possible and it isn't. Thanks in advance for replies....

My Bot down why?

Can anyone fix this why?

GuildMemberUpdate's oldMember doesn't have correct roles.

- Discord.js@14.11.0 - Node v16.20.1 I'm trying to run some code only when a specific role is either added or removed. After just starting the bot; the oldMember will always only have 1 role (@ everyone). After this code has been run at least once (I assumed) the member will be cached and it can correctly determine the oldMember's roles. ...

deploying commands

Hi, how often do i need to re-deploy my commands, it seems they are disspearing every few days?

By hovering over an embed, an 'X' icon appears. Clicking it deletes the embed (doesn't hide it).

Is possible to remove this for my server / bot. What is the event listener when a user press the 'X' icon, like when a user deleted the embed?

50001 and 50013

I am getting a couple of issues related to this .. Node : v17.9.1 d.js : 14.11.0...

AutocompleteInteraction#respond takes a long time to return

my code: ``js const i = Math.random(); console.time(searching-${i}`); const focusedValue = interaction.options.getFocused();...

Custom Emoji formatting issue

I am trying to use custom emojis from a server I own for my bot. The bot is in this server and has admin perms in a different server plus there are no custom emoji restrictions in the channel where the bot is trying to use the emojis. I have tried many methods to use the emojis. For example:...

Need help for storing and access Token from data.json

i want to access token from data.json which is stored like this
{
"userID":"token",
}
{
"userID":"token",
}
...

How can I use an prefix instead of slash?

Explain it simple please, first time using discord.js

Client only deploys 3-4 slash commands

Hey, I have 7 slash commands that I want to deploy but I can't (it only deploys 3 or 4). ```js const { REST, Routes } = require("discord.js"); const fs = require("fs"); const clientId = "1111931372249022474";...

What is the easiest way to edit multiple permissionOverwrites?

So far i have tried <TextChannel>.edit, but this overrides all current permissions. So i've spread those into an array and then pushed the new overwrites into them, but that brings me to point 2: this is for a close ticket command, thus the permissions i edit are for the member that created the ticket, and its setting the SendMessages permission to false Now, if i spread the current permissions, and then add the updated ones, this means the array includes both the current permissions (in which the SendMessages permission is set to true), and the new one, in which it is set to false. Which one of these will override? I assume since the edited ones are the last to be pushed into the array, they will override but i'm unsure ...

Member timeout event?

I want to send an automatic message and save some data on a DB when a member get's timed out using the discord timeout function. Is there any event or something that I can use to catch those timeouts??

function is not a function???

```js client.on(eventName, async (arg) => { for (const eventFile of eventFiles) { const eventFunction = require(eventFile); await eventFunction(client, arg);...

Does discord.js update a guild's scheduled events cache if one is changed

I just ran a test where I looked through a guild's scheduled event, before and after I changed a property on it, and they are the same. So should this be reported to the github or is it just not possible or too miniscule to act on?

Bot not editing embed as expected

```js const existingMessages = await dchannel.messages.fetch({ limit: 1 }); const existingMessage = existingMessages ?.filter((msg) => msg.author.bot && msg.author.id === interaction.client.user.id) .first();...