https://github.com/sapphiredev/utilities/pull/877
Add application commands decorators
1 messages · Page 1 of 1 (latest)
https://github.com/sapphiredev/utilities/pull/877
Add application commands decorators
<@&737143732939259944> can we get a second review here?
<@&737143732939259944>
Do i also need to provide a registry option param?
(builder: SlashCommandBuilder, command: ThisType<CMD> & CMD, options: ApplicationCommandRegistryRegisterOptions)
for people who wants to provide their own ids
Sure, I will get it done later
erm i realized that it's not possible to put registry options param in the callback, so it be in a second param. which would be like this
Ahhh decorators for the registry
Ngl the way i wanted to do it is somehow have a global entry that you'd decorate functions, and params with
Also I'd like if the decorators would only override the register function once, esp if you add all 3 decorators
could you elaborate more? 😅
you mean a single decorator that could register all 3 types and would only override the register function once?
iognore that one, thats more on me to do at some point if ever
this however i worry about
im planning to use a weakmap to store their register type (chat input, context), options and registryOptions and check if it's last applied decorator and register them.
~~https://github.com/sapphiredev/utilities/pull/877/commits/ece89524b187b39ed15bf213974c0b9182b144f1~~
The commit above fails to override once, im currently fixing it
https://github.com/sapphiredev/utilities/pull/877/commits/72965ecc4843eb227c0035e960577cd0171cf76c
This commit makes it only override once
.
@zinc mantle
@zinc mantle I'm going to give you until saturday evening to review this otherwise I'm going to approve and merge it. This PR has been open for far too long already.