Sapphire - Imagine a framework
Sapphire - Imagine a framework

sapphire-support

Root Question Message

JcbSm
JcbSm1/5/2023
Getting the client to log a list of registered commands and if they are global

I was just wondering if there was a way, once the ApplicationCommandRegistry finished initialising, I could get the registered command data?
JcbSm
JcbSm1/5/2023
Also is there part of the guide which explains how to properly delete commands from the application if they are no longer present?

Solution Message

Favna
Favna1/5/2023
client.application.commands, discordjs code
Favna
Favna1/5/2023
and likewise deleting is through discordjs code as well so reference the discordjs guide
JcbSm
JcbSm1/5/2023
Lovely, thankyou
JcbSm
JcbSm1/5/2023
Is there an event that's emitted once the registry is initialised?
Favna
Favna1/5/2023
there isnt but if you can make a small pull request for that, that would be great.

it would have to be the last line in this function: https://github.com/sapphiredev/framework/blob/main/src/lib/utils/application-commands/ApplicationCommandRegistries.ts#L43

Events.CommandApplicationCommandRegistryFinished = "commandApplicationCommandRegistryFinished"
Favna
Favna1/5/2023
it should also be noted that we have a nearly finished PR where we add a BulkOverwrite registry behaviour which when set will always delete all commands and set all commands from pieces by using the bulk overwrite endpoint on the discord api
Favna
Favna1/5/2023
that means you'll never have old commands
Favna
Favna1/5/2023
you will also no longer need to (or can) track idHints
Favna
Favna1/5/2023
if all you care about set it and forget it then that will work for you too
JcbSm
JcbSm1/5/2023
I've never made a PR before, I'd love to learn how to, but I don't want to make peoples life more difficult by doing it completely wrong.
JcbSm
JcbSm1/5/2023
What's the best way to learn? Looking at previous ones?
24
241/5/2023
Make your first PR :)

Look at sapphires contributing guidelines and of course past PRs
Favna
Favna1/5/2023
only one way to learn and that is to just do
Favna
Favna1/5/2023
and if it's wrong then we'll let you know
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy