d.js docs
d.js docs
DIAdiscord.js - Imagine an app
Created by jay on 3/31/2025 in #djs-questions
Can someone please take a look at my code please? Rate limited constantly
:guide: Creating Your Bot: Registering slash commands The command deployment script, to register your slash commands with Discord so they appear in the interface. read more
36 replies
DIAdiscord.js - Imagine an app
Created by jay on 3/31/2025 in #djs-questions
Can someone please take a look at my code please? Rate limited constantly
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
36 replies
DIAdiscord.js - Imagine an app
Created by Jei on 3/31/2025 in #djs-questions
Token invalid
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
25 replies
DIAdiscord.js - Imagine an app
Created by display on 3/30/2025 in #djs-questions
Uncaught exception: ConnectTimeoutError: Connect Timeout Error
Errors such as ECONNRESET, ConnectTimeoutError, SocketError: other side closed indicate a network issue * Free or shared hosting providers often come with significant limitations * Another indication of these issues are 'Unknown Interaction' errors.
19 replies
DIAdiscord.js - Imagine an app
Created by paves on 3/30/2025 in #djs-questions
Unable to send an embed
tag suggestion for @paves: The order of function parameters must match between definition and function call.
function execute(client, interaction) { ... };
execute(interaction, client);
function execute(client, interaction) { ... };
execute(interaction, client);
- mismatch! you pass an interaction where the client is expected - mismatch! you pass the client where an interaction is expected
23 replies
DIAdiscord.js - Imagine an app
Created by TheBear259 on 3/29/2025 in #djs-questions
Global commands not deploying
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
115 replies
DIAdiscord.js - Imagine an app
Created by Duckie on 3/28/2025 in #djs-questions
how to i listen for dm messages
To receive direct message events on "messageCreate" with your bot, you will need: - The DirectMessages gateway intent - The Channel partial setting
10 replies
DIAdiscord.js - Imagine an app
Created by kwamppi on 3/27/2025 in #djs-questions
Slashcommand permissions
- You can only set default permissions (member and DM) in your code. learn more - Be aware that server staff can overwrite all of the suggested permissions to their liking in Server Settings > Integrations.
6 replies
DIAdiscord.js - Imagine an app
Created by Maxi on 3/26/2025 in #djs-questions
Read Desc
:property: ClientApplication#emojis [email protected] The application emoji manager for this application
6 replies
DIAdiscord.js - Imagine an app
Created by Princess Bri Bri 🦄 🌈 on 3/25/2025 in #djs-questions
Series of component interactions
:method: Message#createMessageComponentCollector() [email protected] Creates a message component interaction collector.
// Create a message component interaction collector
const filter = (interaction) => interaction.customId === 'button' && interaction.user.id === 'someId';
const collector = message.createMessageComponentCollector({ filter, time: 15_000 });
collector.on('collect', i => console.log(`Collected ${i.customId}`));
collector.on('end', collected => console.log(`Collected ${collected.size} items`));
// Create a message component interaction collector
const filter = (interaction) => interaction.customId === 'button' && interaction.user.id === 'someId';
const collector = message.createMessageComponentCollector({ filter, time: 15_000 });
collector.on('collect', i => console.log(`Collected ${i.customId}`));
collector.on('end', collected => console.log(`Collected ${collected.size} items`));
3 replies
DIAdiscord.js - Imagine an app
Created by Edwards 270P on 3/24/2025 in #djs-questions
Update from v13 to 14
Please update Node.js to the current LTS (long-term support) version! - Download - Linux (nodesource)
51 replies
DIAdiscord.js - Imagine an app
Created by Edwards 270P on 3/24/2025 in #djs-questions
Update from v13 to 14
Version 14 has released! Please update at your earliest convenience. - Update: npm rm discord.js npm i discord.js - Update guide (use CTRL + F to search for the old method or property)
51 replies
DIAdiscord.js - Imagine an app
Created by Edwards 270P on 3/24/2025 in #djs-questions
Update from v13 to 14
discord.js includes multiple sub-packages, installing these separately can mess with internal code:
npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
npm uninstall discord-api-types @discordjs/rest @discordjs/builders
yarn remove discord-api-types @discordjs/rest @discordjs/builders
pnpm remove discord-api-types @discordjs/rest @discordjs/builders
51 replies
DIAdiscord.js - Imagine an app
Created by Edwards 270P on 3/24/2025 in #djs-questions
Update from v13 to 14
Please update Node.js to the current LTS (long-term support) version! - Download - Linux (nodesource)
51 replies
DIAdiscord.js - Imagine an app
Created by Edwards 270P on 3/24/2025 in #djs-questions
Update from v13 to 14
:guide: Additional Information: Updating from v13 to v14 read more
51 replies
DIAdiscord.js - Imagine an app
Created by Maverick on 3/24/2025 in #djs-questions
Get attachment from command after modal submit
:method: ChatInputCommandInteraction#awaitModalSubmit() [email protected] Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
// Collect a modal submit interaction
const filter = (interaction) => interaction.customId === 'modal';
interaction.awaitModalSubmit({ filter, time: 15_000 })
.then(interaction => console.log(`${interaction.customId} was submitted!`))
.catch(console.error);
// Collect a modal submit interaction
const filter = (interaction) => interaction.customId === 'modal';
interaction.awaitModalSubmit({ filter, time: 15_000 })
.then(interaction => console.log(`${interaction.customId} was submitted!`))
.catch(console.error);
4 replies
DIAdiscord.js - Imagine an app
Created by Maitre Kobayashi on 3/24/2025 in #djs-questions
Discord.js Error with my dropdown menu and button
The ephemeral option when replying to an interaction will be removed in v15
- {..., ephemeral: true}
+ {..., flags: MessageFlags.Ephemeral}
- {..., ephemeral: true}
+ {..., flags: MessageFlags.Ephemeral}
Read here on how to specify multiple flags
23 replies
DIAdiscord.js - Imagine an app
Created by Maitre Kobayashi on 3/24/2025 in #djs-questions
Discord.js Error with my dropdown menu and button
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
23 replies
DIAdiscord.js - Imagine an app
Created by S A H i L on 3/24/2025 in #djs-questions
Unknown interaction
Common causes of DiscordAPIError[10062]: Unknown interaction: - Initial response took more than 3 seconds ➞ defer the response *. - Wrong interaction object inside a collector. - Two processes handling the same command (the first consumes the interaction, so it won't be valid for the other instance) * Note: you cannot defer modal or autocomplete value responses
3 replies
DIAdiscord.js - Imagine an app
Created by Skylife on 3/24/2025 in #djs-questions
rate limit
:discord: Rate Limits Rate limits exist across Discord's APIs to prevent spam, abuse, and service overload. Limits are applied to individual bots and users both on a per-route basis and globally. Individuals are determined using a request's authentication—for example, a bot token for a bot. read more
3 replies