RookieAND_
SIASapphire - Imagine a framework
•Created by RookieAND_ on 12/21/2024 in #sapphire-support
Does Custom Piece auto-loaded?
I am trying to develop a ReservationTask Piece using SapphireJS to perform a specified task after a certain time. First, I created a ReservationTask by extending the Piece class and then created a ReservationTaskStore to store it.
In this case, I wonder if the ReservationTask Piece is automatically registered with SapphireJS. Also, if I add a custom Piece that inherits from this Piece, will it also be automatically added?
I plan to refer to the following code frequently during development:
https://github.com/skyra-project/skyra/blob/6c74782c3e84ce90641f4163e86c60263148b867/src/lib/schedule/structures/Task.ts
P.S
I am trying to register a task that performs a Reservation Task after a certain time through a Command, and I found that in Skyra, it encourages registration through the ScheduleManager.
In this case, the TaskStore retrieves a specific task based on the taskId, but the actual Task class does not have an id value, so I am curious about how this check is done.
6 replies
SIASapphire - Imagine a framework
•Created by RookieAND_ on 12/17/2024 in #sapphire-support
What is the role of a Piece and a Store in SapphireJS?
From my research, it seems that a Piece cannot perform standalone actions. Instead, Pieces are stored in a Store, and developers retrieve them from the container's store to utilize them in other functionalities. Is this correct?
I am looking for examples or related articles that explain the usage of Store and Piece, but the official documentation seems to lack such detailed explanations, so I am asking here.
8 replies