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...
[
{
options: [ [Object], [Object] ],
name: 'test',
name_localizations: undefined,
description: 'This is a test command.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '4',
dm_permission: undefined,
nsfw: undefined
},
{
options: [ [Object] ],
name: 'send',
name_localizations: undefined,
description: 'Send a message.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined
},
{
options: [ [Object], [Object], [Object], [Object] ],
name: 'subcommands',
name_localizations: undefined,
description: 'Test subcommands.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined
},
{
options: [],
name: 'shutdown',
name_localizations: undefined,
description: 'shutdown the bot.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined
},
{
options: [],
name: 'leave',
name_localizations: undefined,
description: 'leave the current guild.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined
}
]
[
{
options: [ [Object], [Object] ],
name: 'test',
name_localizations: undefined,
description: 'This is a test command.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '4',
dm_permission: undefined,
nsfw: undefined
},
{
options: [ [Object] ],
name: 'send',
name_localizations: undefined,
description: 'Send a message.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined
},
{
options: [ [Object], [Object], [Object], [Object] ],
name: 'subcommands',
name_localizations: undefined,
description: 'Test subcommands.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined
},
{
options: [],
name: 'shutdown',
name_localizations: undefined,
description: 'shutdown the bot.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined
},
{
options: [],
name: 'leave',
name_localizations: undefined,
description: 'leave the current guild.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined
}
]
Discord.JS Version: "discord.js": "^14.15.3" Node Version: v22.1.0
No description
8 Replies
d.js toolkit
d.js toolkit4mo 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! - Marked as resolved by OP
d.js docs
d.js docs4mo ago
:discord: Application Resource - Installation Context An app's installation context defines how it's installed: to a server, to a user, or both. read more
Annie
AnnieOP4mo ago
I have both installation contexts checked. I have also added the app to myself by opening its panel and confirming its access.
No description
Annie
AnnieOP4mo ago
So I'm not sure why the commands aren't showing up.
Annie
AnnieOP4mo ago
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...
{
options: [ [Object] ],
name: 'send',
name_localizations: undefined,
description: 'Send a message.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined,
integration_types: [ 0, 1 ],
contexts: [ 0, 1, 2 ]
},
{
options: [ [Object] ],
name: 'send',
name_localizations: undefined,
description: 'Send a message.',
description_localizations: undefined,
default_permission: undefined,
default_member_permissions: '0',
dm_permission: undefined,
nsfw: undefined,
integration_types: [ 0, 1 ],
contexts: [ 0, 1, 2 ]
},
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?
Annie
AnnieOP4mo ago
GitHub
GitHub - discord/user-install-example
Contribute to discord/user-install-example development by creating an account on GitHub.
Annie
AnnieOP4mo ago
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. 👍
Want results from more Discord servers?
Add your server