How to get ID of command?
How can I easily get the ID of a registered command for the purpose of mentioning it? I'll be mentoning the command from another command.
Solution:Jump to solution
The id field isn't stored in Sapphire because it is stored in DiscordJS already. Sapphire will have logged the IDs on initial register if you didn't use bulk overwrite (in which case you should have also added it to
idHints
) but to get it dynamically this is the code:
For Global Commands
```js
import { container } from '@sapphire/framework';...2 Replies
i got as far as
interaction.client.stores.get("commands").get(name)
, but i couldn't find any ID fieldSolution
The id field isn't stored in Sapphire because it is stored in DiscordJS already. Sapphire will have logged the IDs on initial register if you didn't use bulk overwrite (in which case you should have also added it to
idHints
) but to get it dynamically this is the code:
For Global Commands
For Guild Commands