Registration of slash commands and ephemeral messages

22 Replies
d.js toolkit
d.js toolkit3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3y ago
guide Creating Your Bot: Registering slash commands read more
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3y ago
To help you we need more information: • What are you trying to do? • What is your code? • What errors and debug logs do you have?
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3y ago
Version 14 has released! Please update at your earliest convenience. • Update: npm rm discord.js npm i discord.jsUpdate guide (use CTRL + F to search for the old method or property)
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3y ago
guide Popular Topics: Gateway Intents read more
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
treble/luna
treble/luna3y ago
enable them in the dev portal
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3y ago
Error [DisallowedIntents]: Privileged intent provided is not enabled or whitelisted. If you are using the GuildMembers, GuildPresences, or MessageContent intents, you need to enable them in the developer portal: • Developer Portal > Your app > Bot > Privileged Gateway Intents
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
treble/luna
treble/luna3y ago
do you have an interactioncreate event
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
treble/luna
treble/luna3y ago
thats not your interactioncreate
d.js docs
d.js docs3y ago
guide Message Components: Responding to component interactions read more
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View
EndergamerMC
EndergamerMC3y ago
There is an example
const response = await interaction.reply({
content: `Are you sure you want to ban ${target.username} for reason: ${reason}?`,
components: [row],
});

const collectorFilter = i => i.user.id === interaction.user.id;

try {
const confirmation = await response.awaitMessageComponent({ filter: collectorFilter, time: 60000 });
} catch (e) {
await interaction.editReply({ content: 'Confirmation not received within 1 minute, cancelling', components: [] });
}
const response = await interaction.reply({
content: `Are you sure you want to ban ${target.username} for reason: ${reason}?`,
components: [row],
});

const collectorFilter = i => i.user.id === interaction.user.id;

try {
const confirmation = await response.awaitMessageComponent({ filter: collectorFilter, time: 60000 });
} catch (e) {
await interaction.editReply({ content: 'Confirmation not received within 1 minute, cancelling', components: [] });
}
EndergamerMC
EndergamerMC3y ago
Unknown User
Unknown UserOP3y ago
Message Not Public
Sign In & Join Server To View

Did you find this page helpful?