d.js docs
DIAdiscord.js - Imagine an app
•Created by Skullfromroblox on 4/29/2025 in #djs-questions
How to add "ephemeral message" code to my code
We are not Discord, just some nerds who develop Discord bots!
- /report appeals and age updates
- /howtoreport reports (harassment/hacking/spam/abuse)
- /support anything Discord related
- /billing payment/nitro
- /feedback feedback/feature requests
85 replies
DIAdiscord.js - Imagine an app
•Created by Skullfromroblox on 4/29/2025 in #djs-questions
How to add "ephemeral message" code to my code
Codeblocks:
```js
const Discord = require("discord.js");
// further code
```
becomes
Inline Code:
`console.log('inline!');` becomes
console.log('inline!');
85 replies
DIAdiscord.js - Imagine an app
•Created by Skullfromroblox on 4/29/2025 in #djs-questions
How to add "ephemeral message" code to my code
Codeblocks:
```js
const Discord = require("discord.js");
// further code
```
becomes
Inline Code:
`console.log('inline!');` becomes
console.log('inline!');
85 replies
DIAdiscord.js - Imagine an app
•Created by Skullfromroblox on 4/29/2025 in #djs-questions
How to add "ephemeral message" code to my code
The
ephemeral
option when replying to an interaction will be removed in v15
Read here on how to specify multiple flags85 replies
DIAdiscord.js - Imagine an app
•Created by Skullfromroblox on 4/29/2025 in #djs-questions
How to add "ephemeral message" code to my code
:propertysignature: InteractionReplyOptions#flags
[email protected]
Which flags to set for the message. Only MessageFlags.Ephemeral, MessageFlags.SuppressEmbeds, and MessageFlags.SuppressNotifications can be set.85 replies
DIAdiscord.js - Imagine an app
•Created by xTwisteDx on 4/28/2025 in #djs-questions
How do I properly manage a modal?
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 responses21 replies
DIAdiscord.js - Imagine an app
•Created by Panda on 4/28/2025 in #djs-questions
Interactions Confusing themselves w/ modals
18 replies
DIAdiscord.js - Imagine an app
•Created by Panda on 4/28/2025 in #djs-questions
Interactions Confusing themselves w/ modals
:method: ChatInputCommandInteraction#awaitModalSubmit()
[email protected]
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
18 replies
DIAdiscord.js - Imagine an app
•Created by Panda on 4/28/2025 in #djs-questions
Interactions Confusing themselves w/ modals
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
18 replies
DIAdiscord.js - Imagine an app
•Created by bringupyourpost on 4/27/2025 in #djs-questions
how do i check if a user is an admin
documentation suggestion for @bringupyourpost:
:property: BaseInteraction#memberPermissions
[email protected]
The permissions of the member, if one exists, in the channel this interaction was executed in9 replies
DIAdiscord.js - Imagine an app
•Created by nobody on 4/27/2025 in #djs-questions
Type error when sending a container and a action row (CV2)
In TypeScript the
ActionRowBuilder
class has a generic type parameter that specifies the type of component the action row holds:
6 replies
DIAdiscord.js - Imagine an app
•Created by Ryan on 4/27/2025 in #djs-questions
Edit components within a container (CV2)
:method: ContainerComponent#toJSON()
[email protected]
Returns the API-compatible JSON for this component15 replies
DIAdiscord.js - Imagine an app
•Created by Baldy on 4/27/2025 in #djs-questions
Components V2 Select menu
:method: SectionBuilder#setThumbnailAccessory()
[email protected]
Sets the accessory of this section to a thumbnail.16 replies
DIAdiscord.js - Imagine an app
•Created by Luftjunkie_19 on 4/27/2025 in #djs-questions
The up-to-date guide
6 replies
DIAdiscord.js - Imagine an app
•Created by Luftjunkie_19 on 4/27/2025 in #djs-questions
The up-to-date guide
We highly recommend you extend the
Client
structure properly instead of just attaching custom properties like .commands
to the regular discord.js Client
instance.
- Using typescript, you might want to consider casting or augmenting the module type6 replies
DIAdiscord.js - Imagine an app
•Created by DanielBA on 4/27/2025 in #djs-questions
Components v2 error
discord.js includes multiple sub-packages, installing these separately can mess with internal code:
22 replies
DIAdiscord.js - Imagine an app
•Created by DanielBA on 4/27/2025 in #djs-questions
Components v2 error
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
22 replies
DIAdiscord.js - Imagine an app
•Created by Nikode on 4/25/2025 in #djs-questions
what do i do yall???
Resources to understand Promise:
- MDN: learn more
- Guide: learn more
- JavaScript info: learn more
14 replies
DIAdiscord.js - Imagine an app
•Created by #ToiYeuSweetLiquor <3 on 4/23/2025 in #djs-questions
Problem with Action Row
Structures from the API cannot be edited directly. To do so, you can create a new structure (a builder) using the
.from()
method
5 replies
DIAdiscord.js - Imagine an app
•Created by #ToiYeuSweetLiquor <3 on 4/23/2025 in #djs-questions
Problem with Action Row
:method: (static) ActionRowBuilder#from()
[email protected]
Creates a new action row builder from JSON data5 replies