User install Commands

Hello can anyone say me how i make User install commands
30 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Mark
Mark3mo ago
It's not supported in d.js yet, it should be in the next release
Raay
RaayOP3mo ago
Oh ok also in d.js v15? Ah ok Nice thank you But why are there bots that can already do it?
Mark
Mark3mo ago
Because they manually add the data to the json sent to the API You can also do that yourself, or wait for the lib to support it next version
Raay
RaayOP3mo ago
Ah ok thanks
Melo
Melo3mo ago
Eta for next version?
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
Melo
Melo3mo ago
:wah:
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
Melo
Melo3mo ago
Fair
Brad
Brad3mo ago
Discord.js does receive the interactions from user installed apps and responses to them so as long as you deploy the slash commands as user installed it will just work without the guild and channel data as far as I’ve seen so far.
Raay
RaayOP3mo ago
Did you know how i can make taht?
Brad
Brad3mo ago
if (interaction.inGuild() && interaction.guild && interaction.guild.available) {
// guild installed code
} else {
// user installed code
// Keep in mind here you don't have access to any guild or channel data.
}
if (interaction.inGuild() && interaction.guild && interaction.guild.available) {
// guild installed code
} else {
// user installed code
// Keep in mind here you don't have access to any guild or channel data.
}
thats how I decided to do it if someone has better ideas I'm open to suggestions!
Raay
RaayOP3mo ago
Ok thanks
Brad
Brad3mo ago
My apolgoizes! I did mean interaction.guild.available I was typing from memory.
Raay
RaayOP3mo ago
Do you know how i make the User install Code?
Brad
Brad3mo ago
Thank you for that incite I did not look at it previously it does check interaction.guild inside inGuild()!
Raay
RaayOP3mo ago
Yes
d.js docs
d.js docs3mo ago
:discord: Application Commands - Contexts Commands have two sets of contexts on the application command object that let you to configure when and where it can be used: read more
Raay
RaayOP3mo ago
Ok thanks i try it
Raay
RaayOP3mo ago
Can Anyone help me to edit the Index so That is work?
d.js docs
d.js docs3mo ago
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
Raay
RaayOP3mo ago
Oh sorry
Raay
RaayOP3mo ago
Gist
Index.js (DC Bot)
Index.js (DC Bot). GitHub Gist: instantly share code, notes, and snippets.
Raay
RaayOP3mo ago
How i make That (sry i am Not so Long working whith That)
Raay
RaayOP3mo ago
I have make it so
No description
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
Retro
Retro3mo ago
unrelated but you can also do it a bit more efficiently using the spread syntax
{
...(command.data.toJSON()),
context: ...
}
{
...(command.data.toJSON()),
context: ...
}
yeah i mean less characters written. it is slower but he seem to only be registering on startup so ig it kinda doesnt matter
Raay
RaayOP3mo ago
Is it so right?
No description
Raay
RaayOP3mo ago
Oh yes its working Thanks for help me
Want results from more Discord servers?
Add your server