Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SlashCommandStringOptions] Be able to pass arguments to the constructor, or more builder options for SlashCommandStringOption #10303

Closed
Zer0xxxx opened this issue May 28, 2024 · 2 comments

Comments

@Zer0xxxx
Copy link

Which application or package is this feature request for?

discord.js

Feature

I would like to be able to build SlashCommandOption independently of slash commands. To make the whole thing more composable.

Ideal solution or implementation

Be able to instanciate a new SlashCommandOption, and then build it with setName, setDescription, ...

Here, the i18n of the SlashCommandOption is coupled to the creation of the SlashCommand, which is undesirable:
https://discordjs.guide/slash-commands/advanced-creation.html#localizations

Alternative solutions or implementations

No response

Other context

No response

@Zer0xxxx Zer0xxxx changed the title Constructor for SlashCommandOption/more builder options Constructor or builder for SlashCommandOption/more builder options May 28, 2024
@Zer0xxxx Zer0xxxx changed the title Constructor or builder for SlashCommandOption/more builder options Constructor or more builder options for SlashCommandOption May 28, 2024
@Zer0xxxx Zer0xxxx changed the title Constructor or more builder options for SlashCommandOption [SlashCommandOptions] Be able to pass arguments to the constructor, or more builder options for SlashCommandOption May 28, 2024
@Qjuh
Copy link
Contributor

Qjuh commented May 28, 2024

You can make your SlashCommandStringOption anywhere you like: https://discord.js.org/docs/packages/builders/main/SlashCommandStringOption:Class and the addStringOption accepts an instance of that too, not only a function like in the guide you linked. So the feature you request here already exists.

@Zer0xxxx
Copy link
Author

You can make your SlashCommandStringOption anywhere you like: https://discord.js.org/docs/packages/builders/main/SlashCommandStringOption:Class and the addStringOption accepts an instance of that too, not only a function like in the guide you linked. So the feature you request here already exists.

Omg, sorry.
I don't know why, but the autocompletion and the rest of VSCode's tooling was broken on my workflow when I opened this issue. :(

Thank you!

@Zer0xxxx Zer0xxxx changed the title [SlashCommandOptions] Be able to pass arguments to the constructor, or more builder options for SlashCommandOption [SlashCommandStringOptions] Be able to pass arguments to the constructor, or more builder options for SlashCommandStringOption May 28, 2024
@Jiralite Jiralite closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants