discord.js - Imagine an app

DIA

discord.js - Imagine an app

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

Join

djs-questions

djs-voice

shard reconnect loop

hi! here's a portion of logs from my bot's startup progress; it's been on a reconnect loop for shards even though they're ready. I was wondering if this is because of the "unavailableGuilds" thing, never seen this error before. some shards start with unavailableGuilds: 0 and the rest are as you see here. is this a common issue? I've also provided some debug logs that show the errors right before the reconnect loops. if you need any other information from the bot, i'll provide it! (p.s this bot is on a custom clustering package but i just wanted to know if this was an error seen before due to discord.js reasons)...

Routes.guildMembers only returns 1 member

Running into a strange issue with discord.js REST where I am only getting a single result for Routes.guildMembers(guildId) despite the server I am testing clearly having over 5k members. Server Members Intent is enabled in discord dev portal. ```js...

animated sprite

So i want to do a kind of 'build your own' character with layed sprites, static is fine, but i'd like to give it an idle animation. I'm thinking of using Canvas to create the set frames, then animating that as a webP file. using navi-rs/canvas and node-webpmux Would this be the best way....

Guild tag

Using Discord.js or the API directly, is there a way to retrieve the new guild tags displayed next to a user's username? Any help would be appreciated.

edit ephemeral reply

Hello, is there a way to edit an ephemeral reply ?

Help

I need to get systemChannelId when after add a guild

the new SelectMenuBuilder() - Error when adding one in my ContainerBuilder()

Hello, so I am doing my bot using the new Container and I just saw that there is a new way to create select menus. But I got an issue by creating one for the roles. I have a .json file with a few IDs and I want to add each of these IDs as options of the menu. But I got an error and I don't really know how to fix it, so I am asking here Here is my code : https://pastebin.com/0TXLxMu2 ...

Incompatibility Between ActionRowBuilder and interaction.reply()

I accidentally upgraded one of my bots to the latest version of discord.js by doing a downgrade and started getting an error in the type of the InteractionReplyOptions object on the components field, the error indicates that the ActionRowBuilder<ButtonBuilder> object is not compatible with the type expected by the function. In particular, it indicates that the type property is missing, even though the object was constructed correctly according to the documentation. It seems to be a compatibility problem between the type generated by the builder and the type expected by interaction.reply. I am using the same version of discord.js and the same code as provided by the discord.js guide but it still does not work. The error: ```ts...
No description

Trying to edit content of specific v2 component, what's wrong?

I'm running this code on an eval: ```js const { ContainerBuilder } = require('discord.js') ...

My bot disconnect randomly and I don't know why

I have a spaghetti bot that is on ~150 servers, so I no need to shard (normally?). I use Enmap for the database, plus some caching at start. The bot is self-hosted on a raspberry pi 5 (8GB) (+NVM SSD) with PM2 with some other bot, and it's the only that got disconnecting. It's also the only with some memory usage (not more than 300mb). I added a lot of warn to get the error (copium)....

@discord.js/rest pool/bucket stats visibility

I am trying to access the underlying pool stats from the @discordjs/rest package. I currently utilize this package and put the methods behind a proxy (new Proxy(...)) to record the outgoing requests and incoming responses/errors for visibility. My logging (and message broker) is on occasion reporting more requests being sent out than responses are quickly received back. I have limited my code to making requests 20/sec. This shouldn't hit limits, but it's 20/sec constantly and the responses are not coming back in a timely manner (according to my reporting). For helping me debug, I want to access the bucket data that /rest stores internally so I can determine if I am hitting rate limits or if the delayed responses are the result of something else. My current understanding: REST.agent should expose a Dispatcher (docs have a bad link for this class) The Dispatcher, a undici agent should have a stats method to get these pool stats...

Bot RAM usage

Hi, I have a Discord bot that is in around 65,000 servers. I have sharding, and it launches around 65 shards. They all come up, but I have noticed the RAM creeps up (see image) The increase is when I started it, and you can see it creeping up after. I'm worried about how high its going to climb. The bot is super simple, one command and sends a request to an API, then returns the response. Support would be appreciated....
No description

Required options must be placed before non-required options

im trying to register some slash commands, but specifically 2 are failing. ``` 83.options[3][APPLICATION_COMMAND_OPTIONS_REQUIRED_INVALID]: Required options must be placed before non-required options 98.options[1][APPLICATION_COMMAND_OPTIONS_REQUIRED_INVALID]: Required options must be placed before non-required options...

Discord.js User/Client Support (14.19)

Does Discord.js support getting information from the User/Client API? I'm building a Discord bot dashboard, and I'm curious if I can use Discord.js to fetch the servers that the user is in. Obviously, using a user authentication token. Is this possible?...

Cannot get discord bot to join voice channel. 4006 ERROR!

I haven't been able to resolve it myself for hours and I feel like it's not the code but possibly discord's end. I've been looking for support so I hope this is the right place.
Shard ID None WebSocket closed with 4006
Shard ID None WebSocket closed with 4006
Code: ```js import discord...

discordjs in rust

is rust faster with discord bots? what are the benefits? or cons?

Slash command with limited roles selection

Hey there guys, im looking for a way to make a slash command with addRoleOption but limited to roles with specific position. Is it somehow possible to do it with that or do I have to resort to a more custom solution.

Unkown User

```js node:events:496 throw er; // Unhandled 'error' event ^ ...

Is it possible to make discord.js use Redis for Cache?

Hi, I've been having issues with RAM because of discord.js's cache, is there a way to make discord.js cache using redis?