How do I create a User App with Discord.JS?
I imagined I could use the same setup I have for...
Routes.applicationGuildCommands(env.appID, env.defaultGuild)
, but with Routes.applicationCommands(env.appID)
.
However this doesn't work, I just get the commands registered only in my guild.
What am I doing wrong? Is there a code example somewhere that I can view?
The JSON I'm sending...
Discord.JS Version: "discord.js": "^14.15.3"
Node Version: v22.1.0
8 Replies
- 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!
- ✅
Marked as resolved by OPI have both installation contexts checked. I have also added the app to myself by opening its panel and confirming its access.
So I'm not sure why the commands aren't showing up.
you have to provide the contexts in your commands
https://discord.com/developers/docs/interactions/application-commands#interaction-contexts
I couldn't find how one would do this in the DiscordJS command builder so I ended up adding them myself. I now have this...
However when I use it in a server it says that I don't have permission (and that only I can see the response).
Edit: This was a mistake with permission settings.
I can use other apps just fine, is this a restriction between verified and non-verified bots?
This is a decent example: https://github.com/discord/user-install-example/
GitHub
GitHub - discord/user-install-example
Contribute to discord/user-install-example development by creating an account on GitHub.
Ah I see. I'll use my own patch for it, for now and update to use them as defined in the builder when it's in stable. 👍