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

Components v2 - SectionBuilder with button

Hey everyone. I'm trying to add a ButtonBuilder to a SectionBuilder, nested in a ContainerBuilder. But when trying to post the message, I get an error: ``` path/node_modules/@discordjs/builders/dist/index.mjs:486 throw new RangeError("Non-premium buttons must have a label and/or an emoji.");...

Components timeout causing "Unknown Message" error on ephemeral messages

Hey all, I did a bit of research before posting this but I'm still a bit confused, I'm wondering what would be the best way (if possible) to disable components on ephemeral messages. I'm currently trying to disable select menus after a timeout period using my component handler, but I'm getting a DiscordAPIError[10008]: Unknown Message error. My current setup does majority of the component handling within my components.js file, the rest being within the command files itself. The handler disables components after a certain time (2 minutes in my case). The error occurs in the disableComponents function when trying to edit ephemeral messages. The message exists when the timeout triggers, but the edit fails. I've considered just letting the components expire naturally, but I'd prefer to have them visibly disabled for better UX. I've also tried checking if the message is ephemeral before attempting to edit, but I'm not sure where to extend from this other then just ignoring the error....

Better way to see if user is in channel

I want to check if a user is in the same channel as the executed command. My current solution is quite big and complex. Is there a simpler/smaller way of achieving this? ```js const opponent = interaction.options.getUser("opponent"); const guild = interaction.guild; ...

Error: Discord API call failed: read ECONNRESET

So, I am making a FiveM server and I have a discord.js bot. The bot is supposed to: - Detect when there is a new role assigned to a user - Then assign the corresponding group (in game version of the role with the in game permissions etc) by grabbing their discord user id from the database ...
No description

A bot that uses multiple discord bots

Basicly my bot wukk get rate limited alot as it will create alot of channels and drag members when it create game vcs so I need a bot to just create the channels and drag members and one to send the messages and roles and som1 pls help <3 thanks!!!!

How to send ephemeral messages in new updates?

I am back to discrod.js after quite a while, I used to send ephemeral messages by using the ephemeral: true in the interaction response like this: ```js await interaction.reply({ /Message Conetent & Stuff/ ephemeral: true...

How to scale smoothly?

Regarding the sharding part, here's the situation. With num_shards = 2, I launched two local processes with shard_id: 0: [0, 2] and [1, 2]. Then I have three servers: A, B, and C. ...

internal sharding docs

Hello! I'm starting to use internal sharding but I can't find anywhere in the docs where I can check shard info (like number of shards)

how i can make like this server tags logging bot using djs

for my tag server like my question is how i can fetch this server tag
No description

Unable to see (/) commands

I'm trying to follow the guide on the part of creating slash commands, and this is my main.js file, and my bot is up and running correctly, but the slash command won't show up.

Slash Command Help

how to name slash command without accents - instead of spaces. For example /embed create instead of /embed-create for slash command?

i got error for removing the semi colon

i got error for removing the semi colon

Testing djs commands/flows

What's the generic consensus for (unit/integration) testing commands? Mock the djs return values? Room for error if I my mock doesn't reproduce the behaviour accurately. I'm currently testing all of the beneath code for accessing my data (services/models)....

Bot not joining server

Hi, i'm knew to coding and building bots, and I tried to follow all the discordjs guide instructions, and ran the code for the bot, but when I copied the discord bot install link from the discord bot application settings thing, and pasted in into a new tab and invited it to the server I wanted, it didn't show up in the server.
No description

Is there a way to take a (non-zip) folder as input for a slash command

attempting to upload a folder that contains json files, currently failing to upload the attachment via addAttachmentOption. Is there a way to upload a folder to a slash command (would like the input itself not to be a zip, but if there's a way to zip and then unzip the input thats fine)

Optimizing Cache Management for a High-Volume Discord Bot

Hello everyone, I'm currently developing a Discord bot that's active on approximately 1,200 servers, with some servers exceeding 20,000 members. The bot generates a significant number of logs, which is beneficial for monitoring and moderation purposes. However, I've encountered issues related to user data caching: certain user information, such as profile pictures or usernames, becomes outdated because those users aren't present in the cache. I'm seeking strategies to optimize the bot's overall cache management. Specifically, I'm interested in:...
No description

Errors in config.json, deploy-commands.js, and index.js

I think I messed up something simple here. I'm following the discord.js guide and I'm this (https://discordjs.guide/creating-your-bot/command-deployment.html#command-registration) section right here, and I'm getting a bunch of errors in vscode despite following the guide step by step. I even copied the index.js, deploy-commands.js, and config.json from the github to make sure it wasn't a typo problem (I edited config.json with my own keys of course). Still no luck. When I run deploy-commands,js I get picture attached....
No description