Application Command Registry Interface v1
@here Your feedback is required again! We're inching closer and closer to having application commands in Sapphire, but there's still places where polishing is required, and most importantly, your feedback is wanted!
As you're hopefully used to already, here's the notion doc with examples: https://vladfrangu.notion.site/Current-code-examples-for-registering-Application-Commands-in-Sapphire-6720eeb8f8be4cfa92292c44f1db9a2c
Please note that these are samples. They may change per your feedback, and at the end, I will create a repository showing it off in an actual code base for those that have uncertainties!
So hit me in the thread attached to this message - thoughts? Like it? Dislike it? Why? What would you want to see different?
Vlad Frangu's Notion on Notion
Current code examples for registering Application Commands in Sapphire
Per the vote in the thread, I've been drafting code samples with how you can register commands in Sapphire. Feedback is important, so please reply in the thread attached to this with your thoughts.
135 Replies
looks great
how in the mcfuck did you read that document so fast
um
bulgarian genetics
registry
cool
looks great
its like windows
actually when i started to read it
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
looks pretty good
For context, to me this feels like the cleanest way to register what command classes can handle what slash commands (and also handle things like guild commands that are supposed to run the same code, etc)
This will also handle registering it with Discord for you!
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
overrideBehaviorOnDuplicate
maybe?So
The store is a Store?
A sapphire pieces store?
i like stores
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
no
the RegistryStore is a store of registries, not a piece
Namings
the registry stuff feels kinda weird compared to the rest of sapphire's stuff
not something bad per se, tho
Yeh might wanna avoid that
Because if it was a store. The container property makes no sense. But since its not. The name makes no sense
Haha
Only feedback I got
NAMING ASIDE
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
I'll search a better name for the registry store
ideally as little as possible
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
:No:
@vladdy can you make it so
registerApplicationCommands
is automatically called by setting a CommandOption? such as
registerChatInputCommand: boolean
which then uses the defaults of this.name
and this.description
, and default_permission
to true
(also default, no need to specify that one)
This will save on having to override and implement that method either on every command or force everyone to create their own command class that extends command to do the same.Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
Released when?
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
registerApplicationCommands is automatically called if it's present no matter what. However, I am against the defaults part, especially with some upcoming features for application commands
no I don't meean if it's present. I don't want to have it to be present at all in my code.
Nick shutup
nickk please keep the thread serious
when most people are happy
ok well i dont really understand this registry thing
Then don't participate.
ok
.
oh so its like an in depth command
Please explain whats confusing about it :D
idk long words
I don't know what Vladdy's plans are per se but Permissions v2 will deprecate mostly anything of what we would make.
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
actionWhenCommandIsPresentButNotIdentical
thats a really long one
Permissions are undergoing changes at Discord's level, so, at this time, no
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
Then get a dictionary and disect every word @friedxd. We're not a primary school here.
😦
well yes and not, they mean different things both for us internally and you externally
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
OHHHH this is for like application commands
that looks great
Highly unlikely to happen due to the fact people may want to, for instance, intl their description know it's annoying
then they override it?
or they dont set the option?
I never said the option should default to true
Hmm
Default it to false in fact if you want, that's fine by me
writing code...
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
Why are we deviating from "store.get"?
Because you can use it without the ping command having a registry already
I can consider a
registerChatInputCommandWithDefaults
I suppose, but it's definitely not my priority rn. I'd need to think of a name, deal with the default_permissions headache, options too, just.. its really not something that I see as a need due to most commands having at least an arg
But noted
This is very clean and concise. Much more so than
how would you provide the registerbehavior
Is it a default to overwrite?
ninja'd it in
log to console?
uh didn't you write in the notion the default is warn rn?
Well yes
trying to see if I missed anyone else's message
What's confusing you the most?
These methods separate how we route the interactions we get to the right file/method, hence why there's a split between chat input and context menu commands, even if they look like they do the same thing
This will mean we must make command descriptions required. Thats an annoyance for non-chat input command users, I guess I can make it required only for those that use the options but still..
Maybe that it isn't a piece, while everything else is a piece?
Although I understand the hot mess that would be handling the command registering from
Command
class at the same time you handle everything elseThe registry is simply a fancy ui for a map of what goes where. Ignore the store in the name of the ApplicationCommandRegistryStore
something like this could be great, from my opinion
of that, are there any questions, suggestions, requests, issues, broken dreams?
honestly I want to see how this pans out
I want to see how this integrates with existing sapphire applications, and see how it works
Well I wanna get it right the first time
I think accepting both builders is a great thing, and I kinda think the syntax is fine... maybe bloated, but works
I don't know if I'd change the names though.
"CommandThingy", "StoringThingy", "UnnamedThing2" (?)
Yean names are elongatedbois rn its pain
How does
whenCommandIsPresentButNotIdentical
sound? @Favna @daimond113 @twenty_fourUnknown User•4y ago
Message Not Public
Sign In & Join Server To View
better...
commandOverrideStrategy
?Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
I see it being vague... override what??
override is vague
commandAmbiguityStrategy
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
2 characters longer than mind... smh
ifCommandPresentButNotIdentical
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
ifCommandPresentNotIdentical
no buts here boysUnknown User•4y ago
Message Not Public
Sign In & Join Server To View
whatToDoOnCommandMatch
whenPresentButNotIdentical
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
technically uk
practically idk
whatToWithIdenticalCommand
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
behaviorWhenNotIdentical
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
I think that works
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
minus the obviously wrong british spelling (usa strong)
well I'm not bri'ish
so its the us spelling
well thank god for that
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
no
we don't test here
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
yeah, no worries here bud
(note: not responsible for test deletion)
current line/total lines
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
not when you have DI
just
.get
itUnknown User•4y ago
Message Not Public
Sign In & Join Server To View
Plenty broken dreams
So, people here, other than the feedback you gave me about the 3 things, is there anything else? I wanna know before I work on the implementation
Nah. Just naming (:
@here
waketh up 🙏
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
no
im wacthig
already solved
its at the bottom of the notion
think this system works
the faster I get feedback, the faster the progress
its cool
do it as it is nopw
LGTM.
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
What about them
I already explained they handle different things internally
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
you mean..an..array..of register calls?
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
is that REALLY needed
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
For
I say you can DIY it with an array and calling the method
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
That's what I thought
aight time to get to coding
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
they're options so I would presume they'll be handled as such
unaware of actual intentions though
well right now you get a generic discord.js CommandInteraction/ContextMenuInteraction, so I assume the plugins will update to give a nicer support too
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View