Let's users have custom folders for pieces
As the title states, I think sapphire should let people place commands, listeners and interaction handlers...etc( all pieces ) in custom folders. Maybe sapphire should let people set the paths of those pieces in
SapphireClientOptions
.Solution:Jump to solution
Already possible. You can register a path for a store.
If it is for a single store then use
```ts
<this>.container.stores.get('mystore').registerPath('path/to/the/folder/here')...
12 Replies
Solution
Already possible. You can register a path for a store.
If it is for a single store then use
If the path has subsequent folders of
commands
, listeners
etc (i.e. a more DPy strategy of using cogs) then you can use
Ideally you would put these in an overloaded constructor of a SapphireClient, so something like:
Docs: https://www.sapphirejs.dev/docs/Documentation/api-pieces/classes/Store#registerpath and https://www.sapphirejs.dev/docs/Documentation/api-pieces/classes/StoreRegistry#registerpathHow
yeah I was still getting links
ill edit that msg
So you mean I can place my interaction-handlers in a folder named
handlers
?if it extends InteractionHandler, probably
i don't think it matters where you put it
just as long it extends one of the classes
https://github.com/Greensky-gs/lofi-girl/blob/master/src/index.ts
Something like this
GitHub
lofi-girl/index.ts at master · Greensky-gs/lofi-girl
Lofi girl bot's source code. Contribute to Greensky-gs/lofi-girl development by creating an account on GitHub.
Ok
edited @Naryani Priya
Thanks
just to clarify for me, you can add helperfiles as pieces and the hmr will then reload this files on change too?
If they're in a store, yes
But that's not so much adding a custom folder for an existing store as it is creating your own new store
Not to mention this PR is done and ready for review
GitHub Pull Request data for @Chillihero:
<:_:864240877479657482> #415 in sapphiredev/plugins by favna opened <t:1675012551:R>
feat: add utilities-store plugin