How should you, the end user, define commands?
⚠️ How should you define what application commands are for what command classes, and how should they be registered for you? (SUPER IMPORTANT QUESTION)
1️⃣: Default by the
command.name
, otherwise command.chatInputName
(for chat input commands) or command.contextMenuName
for context menus, and provide a utility function on the command store that lets you register them if missing at ready (can go into more details if this option is chosen)
2️⃣: Passing in an array of @discordjs/builders
in the command class's options, which get pushed to the API based on client settings (as above, with some options for handling existing commands and what not)
3️⃣: Propose a better solution50 Replies
Maybe letting them choose any one? Like making the constructor use an object but make it optional and use a function for builder function and make it optional too?
So that people will and can use what they want
That'd be an interface hell
I mean that's the only better solution I could get into
As some people prefer objects
While some prefer builder
Thats again not even the question at hand
pls re-read
I go with 1
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
well the third option is the "other" of forms that basically say "you say something else"
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
Application commands stands for slash commands and context menu right ?
Yes
Will those be treated like other commands (in the
commands
folder) or is it going to be something totally separated ?That's been answered in <#894234449133322281> pretty sure-right no transcript
same folder
I like approach 2 more, seeing as DJS also has pushed people to use djs/builders
Option 1 seems easier in theory, but I think option 2 would be easier to implement and maybe better for people moving from DJS to sapphire
I dunno... putting builders in the command options is..gonna get big fast
this is true
I did enjoy how the
setUp
method that was theorized in the slash plugin accepted a builder, or was going toSo in summary option 1 is that ?
if we only care about name in the options, no. 1 is best, but if we want to register the whole command, v2 seems best (more flexible) at the cost of the biggie constructor
close, you'd have a different function for chatInputCommands and contextMenuCommands @caesarovich
Oh yeah sure
run will be deprecated then ?
run would likely be removed, no?
run is renamed to messageRun
A bit sad that we'll have two functions for the same command
i guess then we'll only have slash commands so lol
you could just make a
#private
method that is called from both of the run methods^
but the logic would be different (interaction.member, msg.member, ect) based on args
where do you want the votes? anyway 1️⃣
2️⃣
just in messages, I can figure out stuff
I personally want 1
wait we need a poll
@Skyra
The prefix in this server is currently set to
s!
is there a documentation for builders ? i never used that
GitHub
builders/Slash Command Builders.md at main · discordjs/builders
A collection of builders that you can use when creating your bot. - builders/Slash Command Builders.md at main · discordjs/builders
s!poll Option 1, Option 2, Option 3 (please suggest)
1️⃣ → Option 1
2️⃣ → Option 2
3️⃣ → Option 3 (please suggest)
ty
I think I'll be very much outvoted here
but I think both options are good approaches so I don't mind
it barely started lol
just wait
waiting??? ⌚
So with builders you can dynamically adapt the command to the context I guess 🤔
the builders are mostly what we'll send to discord
I should look into the API docs directly
Quite don't get what the new features involves
I wouldnt differntiate the name to begin with. I dont see a use in having a different name for a slash command opposed to a chat command. It would in most cases confuse the user why something is named different.
Builder could be optional espescially for very good control n your slash command. But honestly. I'd rather have the options on the main definition itself (or a sub object) turned into a builder
Wat
Also like, don't forget that unlike message commands, application commands don't support aliases
What dont you understand from my message haha
I know
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
nah you definitely got it right
There's downsides and upsides for every method
>w>
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
My opinion (in the other thread) is already that I dont consider context menus a command anyways. That goes hand in hand with my opinion here.
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
Discord considers them commands
And so will we