Interface: ScheduledTasks
The registered tasks and their payload types. When registering new ones, it is recommended to use module augmentation so custom ones are registered.
Remarks
- If the type is
never
orundefined
, that means that there is no payload associated with that task. - If the type is a union that contains
undefined
, then the payload will be optional.
Example
declare module '@sapphire/plugin-scheduled-tasks' {
interface ScheduledTasks {
// A task named `Mute` which requires no payload:
Mute: never;
// A task named `Unmute` which requires a payload with a `userId` property:
Unmute: {
userId: string;
};
// A task named `Ban` which has a payload with an optional `moderatorId` property:
LogAction: {
moderatorId?: string;
};
}
}