User Install (The new update)

Hello, I am attempting to make my JavaScript d.js Discord Bot work with the new User Install feature (The new update). To do this, I need to modify the handleCommands, but this is only found with the normal discord.js framework, which leads me wondering how to add the system to make the new UserInstall feature work with my sapphire framework. If anyone could assist, I would be grateful!
Solution:
they should still work the same way. The only thing is that the commands need to be registered with
contexts: [<values>],
integration_types: [<values>]
contexts: [<values>],
integration_types: [<values>]
inside of the command registry. If youre using the builders i dont think they currently support it, but if youre putting in the raw API data it should work just fine...
Jump to solution
11 Replies
Solution
KaydaFox
KaydaFox8mo ago
they should still work the same way. The only thing is that the commands need to be registered with
contexts: [<values>],
integration_types: [<values>]
contexts: [<values>],
integration_types: [<values>]
inside of the command registry. If youre using the builders i dont think they currently support it, but if youre putting in the raw API data it should work just fine
Favna
Favna8mo ago
yeah nothing for builders for that yet. My bet is you need to be patient for the libraries to be properly updated. https://discord.js.org/docs/packages/builders/main/SlashCommandBuilder:Class
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Wxrning
Wxrning8mo ago
Well, here is my Bot's File Tree
No description
No description
No description
Favna
Favna8mo ago
that's all well and good but if DiscordJS doesn't support it yet then it isn't supported yet. Same as KaydaFox said.
Wxrning
Wxrning8mo ago
Is this using builders?
const { EmbedBuilder } = require('discord.js');

class UserCommand extends BeemoCommand {
/**
* @param {BeemoCommand.Context} context
* @param {BeemoCommand.Options} options
*/
constructor(context, options) {
super(context, {
...options,
description: '',
permissionLevel: PermissionLevels.BotOwner
});
}

/**
* @param {BeemoCommand.Registry} registry
*/
registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder //
.setName('')
.setDescription(this.description)
);
}

/**
* @param {BeemoCommand.ChatInputCommandInteraction} interaction
*/
async chatInputRun(interaction) {
const { EmbedBuilder } = require('discord.js');

class UserCommand extends BeemoCommand {
/**
* @param {BeemoCommand.Context} context
* @param {BeemoCommand.Options} options
*/
constructor(context, options) {
super(context, {
...options,
description: '',
permissionLevel: PermissionLevels.BotOwner
});
}

/**
* @param {BeemoCommand.Registry} registry
*/
registerApplicationCommands(registry) {
registry.registerChatInputCommand((builder) =>
builder //
.setName('')
.setDescription(this.description)
);
}

/**
* @param {BeemoCommand.ChatInputCommandInteraction} interaction
*/
async chatInputRun(interaction) {
Favna
Favna8mo ago
that should answer it
No description
Wxrning
Wxrning8mo ago
Ah I see
Favna
Favna8mo ago
https://refactoring.guru/design-patterns/builder it's important to know design patterns as a developer :thumbnite:
Builder
Builder is a creational design pattern that lets you construct complex objects step by step. The pattern allows you to produce different types and representations of an object using the same construction code.
Wxrning
Wxrning8mo ago
So, your saying discord has to add a way for me to make User Installs work?
Favna
Favna8mo ago
discordjs* yes
Wxrning
Wxrning8mo ago
Will do :cat_hehe: I see, pretty unfortunate
Want results from more Discord servers?
Add your server