User install Commands

Hello can anyone say me how i make User install commands
30 Replies
d.js toolkit
d.js toolkit5mo 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
Mark5mo ago
It's not supported in d.js yet, it should be in the next release
Raay
RaayOP5mo ago
Oh ok also in d.js v15? Ah ok Nice thank you But why are there bots that can already do it?
Mark
Mark5mo 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
RaayOP5mo ago
Ah ok thanks
Melo
Melo5mo ago
Eta for next version?
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Melo
Melo5mo ago
:wah:
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Melo
Melo5mo ago
Fair
Brad
Brad5mo 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
RaayOP4mo ago
Did you know how i can make taht?
Brad
Brad4mo 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
RaayOP4mo ago
Ok thanks
Brad
Brad4mo ago
My apolgoizes! I did mean interaction.guild.available I was typing from memory.
Raay
RaayOP4mo ago
Do you know how i make the User install Code?
Brad
Brad4mo ago
Thank you for that incite I did not look at it previously it does check interaction.guild inside inGuild()!
Raay
RaayOP4mo ago
Yes
d.js docs
d.js docs4mo 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
RaayOP4mo ago
Ok thanks i try it
Raay
RaayOP4mo ago
Can Anyone help me to edit the Index so That is work?
d.js docs
d.js docs4mo 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
RaayOP4mo ago
Oh sorry
Raay
RaayOP4mo ago
Gist
Index.js (DC Bot)
Index.js (DC Bot). GitHub Gist: instantly share code, notes, and snippets.
Raay
RaayOP4mo ago
How i make That (sry i am Not so Long working whith That)
Raay
RaayOP4mo ago
I have make it so
No description
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
Retro
Retro4mo 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
RaayOP4mo ago
Is it so right?
No description
Raay
RaayOP4mo ago
Oh yes its working Thanks for help me
Want results from more Discord servers?
Add your server