discord.js - Imagine an app

DIA

discord.js - Imagine an app

Support server for discord.js, a Node.js module to interact with Discords apps API.

Join

djs-questions

djs-voice

Guilds request AI

```js app.get('/users/guilds', async (req, res) => { const token = req.cookies.token; console.log('Token received:', token); ...

How do I convert this a permission int into an PermissionString[]

Hello, I am watching the GuildAuditLogEntryCreate event and when a permission is updated i am getting this in the entry changes: [ { key: 'permissions', old: 8797166764176, new: 8797166764160 } ], I want to see which permissions has been changes so I hhave seen on the documentation that I can use PermissionsBitsField, I wrote this...

Does the REST handler retry failed requests?

See title. I'm mainly referring to errors with a 5xx code, but I do want to know if the REST handler retries any requests of any type. I want to handle those errors and would like to know if I'm just repeating error handling logic that discord.js already performs. And if there are community resources or examples on how best to implement this please point me to them, I wasn't able to find anything when I looked....

Fetch all reactions from a message but without cache

Hey there, is that a way to fetch all reactions attached to a message without using the cache function? This is my current code ```...

Do not know how to serialize a BigInt at JSON.stringify

Hey quick question. Ive been trying many different things but i am still getting this error:
TypeError: Do not know how to serialize a BigInt at JSON.stringify (<anonymous>)
TypeError: Do not know how to serialize a BigInt at JSON.stringify (<anonymous>)
im trying to convert PermissionsResolvable to PermissionsBitField wondering if anyone has ever gotten this issue and knows how to fix it...

Make a select menu builder for certain roles?

I am kinda new to coding and confused on how I can make a select menu for certain roles. I can get the menu sent but don't know how to make a certain interaction add a certain role.

Bot that listens to code words

How do I make a bot that listens to a "secret code word" and performs an action when someone says it? This cannot be a slash command because slash commands show up when you type in "/".

Ephemeral didn't work

i have no idea why this code not working
No description

Why can't I click to view the user profile?

- My code: ```javascript module.exports = async function welcomeMember(member) { try { const fetchedMember = await member.guild.members.fetch(member.id);...
No description

I need help to make the messages personal in a Discord channel for newcome

I am facing an issue where I am unable to send a personal message to new users on my Discord server. I want the message to look like it does in the second screenshot, rather than the way it appears in the third screenshot. Attached is the source code related to this problem: //Тикет client.on('guildMemberAdd', async (member) => { // Упоминание нового участника в канале для заявок const applicationChannel = member.guild.channels.cache.find(channel => channel.id === '1286402427616235540'); // Замените '1286402427616235540' на реальный ID канала ...
No description

value of autocomplete gets lost after switching to other channel and back

I have encountered an issue where the value of my autoselect gets lost in the execute method after i switch to another channel and then execute the command Autocomplete code ```ts if (focusedOption.name === optionNames.date) {...

How do add a user to a thread silently?

My discord bot currently adds people to a thread like this:
await threadChannel.members.add(userID);
await threadChannel.members.add(userID);
But this results in the following message (at bottom)....
No description

Typescript Error 'typeof Client' incorrectly extends base class

Node v20.16.0
djs v14.16.3
TS v5.6.3
Node v20.16.0
djs v14.16.3
TS v5.6.3
...

Sharding questions.

Hi. I am building a Discord bot which I can anticipate will eventually be in more than 2500 guilds pretty quick. I have a few questions about sharding which I am looking to have answered, any help is greatly appreciated:...

How to respond negatively to an autocomplete interaction?

Discord's documentation really doesn't make this clear unless I'm missing something... Should I interaction.respond() with an empty array? Or just not respond at all? Or respond in some other way?...

How to check whether a user can be DMed?

See title. The best I can figure out is actually trying to send a DM, but by the point I'm doing that there's nothing I can do if it fails, so it would be nice if there's a better way to check.

Broken button handler: "interaction.isButton is not a function"

Discord.js npm version: 14.16.3 Node.js version: 20.9.0 Since yesterday I cant handle any interaction events where I check if the interaction is a button / chatinputcommand or modalsubmit interaction anymore (I only have these three). They are all build similar. ...
No description

New commands only appear after completely removing and re-adding bot from servers

This is my deploy-commands.js: `const { REST, Routes } = require('discord.js'); const { clientId, token } = require('./config.json'); const fs = require('fs'); const path = require('path');...