@sapphire/plugin-scheduled-tasks 10.0.2-next.5193167 → 10.0.2-next.51af5e9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
**Plugin for <a href="https://github.com/sapphiredev/framework">@sapphire/framework</a> to add support for scheduled tasks using <a href="https://github.com/taskforcesh/bullmq">bullmq</a>.**
|
|
8
8
|
|
|
9
9
|
[](https://github.com/sapphiredev/plugins/blob/main/LICENSE.md)
|
|
10
|
-
[](https://codecov.io/gh/sapphiredev/plugins)
|
|
11
10
|
[](https://bundlephobia.com/result?p=@sapphire/plugin-scheduled-tasks)
|
|
12
11
|
[](https://www.npmjs.com/package/@sapphire/plugin-scheduled-tasks)
|
|
13
12
|
|
|
@@ -74,7 +73,8 @@ import { container } from '@sapphire/framework';
|
|
|
74
73
|
|
|
75
74
|
export class MyAwesomeService {
|
|
76
75
|
public createAwesomeTask() {
|
|
77
|
-
|
|
76
|
+
const payload = { awesome: true };
|
|
77
|
+
container.tasks.create({ name: 'awesome', payload }, 2000);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
```
|
|
@@ -96,7 +96,8 @@ export class MuteCommand extends Command {
|
|
|
96
96
|
|
|
97
97
|
public async run(message: Message) {
|
|
98
98
|
// create a task to unmute the user in 1 minute
|
|
99
|
-
|
|
99
|
+
const payload = { authorId: message.author.id };
|
|
100
|
+
this.container.tasks.create({ name: 'unmute', payload }, 60_000);
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
```
|
|
@@ -132,14 +133,15 @@ declare module '@sapphire/plugin-scheduled-tasks' {
|
|
|
132
133
|
##### Using Manual Tasks
|
|
133
134
|
|
|
134
135
|
```typescript
|
|
135
|
-
|
|
136
|
+
const payload = { awesome: true };
|
|
137
|
+
container.tasks.create({ name: 'manual', payload }, 5000);
|
|
136
138
|
```
|
|
137
139
|
|
|
138
140
|
#### Pattern Task Example
|
|
139
141
|
|
|
140
142
|
Pattern jobs are currently only supported by the Redis strategy.
|
|
141
143
|
|
|
142
|
-
##### Creating the Piece
|
|
144
|
+
##### Creating the Piece
|
|
143
145
|
|
|
144
146
|
```typescript
|
|
145
147
|
import { ScheduledTask } from '@sapphire/plugin-scheduled-tasks';
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ var ScheduledTaskEvents_cjs = require('./lib/types/ScheduledTaskEvents.cjs');
|
|
|
7
7
|
var _load_cjs = require('./listeners/_load.cjs');
|
|
8
8
|
|
|
9
9
|
// src/index.ts
|
|
10
|
-
var version = "10.0.2-next.
|
|
10
|
+
var version = "10.0.2-next.51af5e9";
|
|
11
11
|
|
|
12
12
|
Object.defineProperty(exports, "loadListeners", {
|
|
13
13
|
enumerable: true,
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAwCO,IAAM,OAAkB,GAAA","file":"index.cjs","sourcesContent":["import type { ScheduledTaskHandler } from './lib/ScheduledTaskHandler';\nimport type { ScheduledTaskStore } from './lib/structures/ScheduledTaskStore';\nimport type { ScheduledTaskHandlerOptions } from './lib/types/ScheduledTaskTypes';\n\nexport * from './lib/ScheduledTaskHandler';\nexport * from './lib/structures/ScheduledTask';\nexport * from './lib/structures/ScheduledTaskStore';\nexport * from './lib/types/ScheduledTaskEvents';\nexport type * from './lib/types/ScheduledTaskTypes';\n\nexport { loadListeners } from './listeners/_load';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\ttasks: ScheduledTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'scheduled-tasks': ScheduledTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\ttasks: ScheduledTaskHandlerOptions;\n\t\t/**\n\t\t * If the the pre-included scheduled task error listeners should be loaded\n\t\t * @default true\n\t\t */\n\t\tloadScheduledTaskErrorListeners?: boolean;\n\t}\n}\n\n/**\n * The [@sapphire/plugin-scheduled-tasks](https://github.com/sapphiredev/plugins/blob/main/packages/scheduled-tasks) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '10.0.2-next.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAwCO,IAAM,OAAkB,GAAA","file":"index.cjs","sourcesContent":["import type { ScheduledTaskHandler } from './lib/ScheduledTaskHandler';\nimport type { ScheduledTaskStore } from './lib/structures/ScheduledTaskStore';\nimport type { ScheduledTaskHandlerOptions } from './lib/types/ScheduledTaskTypes';\n\nexport * from './lib/ScheduledTaskHandler';\nexport * from './lib/structures/ScheduledTask';\nexport * from './lib/structures/ScheduledTaskStore';\nexport * from './lib/types/ScheduledTaskEvents';\nexport type * from './lib/types/ScheduledTaskTypes';\n\nexport { loadListeners } from './listeners/_load';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\ttasks: ScheduledTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'scheduled-tasks': ScheduledTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\ttasks: ScheduledTaskHandlerOptions;\n\t\t/**\n\t\t * If the the pre-included scheduled task error listeners should be loaded\n\t\t * @default true\n\t\t */\n\t\tloadScheduledTaskErrorListeners?: boolean;\n\t}\n}\n\n/**\n * The [@sapphire/plugin-scheduled-tasks](https://github.com/sapphiredev/plugins/blob/main/packages/scheduled-tasks) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '10.0.2-next.51af5e9';\n"]}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ export * from './lib/structures/ScheduledTaskStore.mjs';
|
|
|
5
5
|
export * from './lib/types/ScheduledTaskEvents.mjs';
|
|
6
6
|
export { loadListeners } from './listeners/_load.mjs';
|
|
7
7
|
|
|
8
|
-
var version = "10.0.2-next.
|
|
8
|
+
var version = "10.0.2-next.51af5e9";
|
|
9
9
|
|
|
10
10
|
export { version };
|
|
11
11
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;AAwCO,IAAM,OAAkB,GAAA","file":"index.mjs","sourcesContent":["import type { ScheduledTaskHandler } from './lib/ScheduledTaskHandler';\nimport type { ScheduledTaskStore } from './lib/structures/ScheduledTaskStore';\nimport type { ScheduledTaskHandlerOptions } from './lib/types/ScheduledTaskTypes';\n\nexport * from './lib/ScheduledTaskHandler';\nexport * from './lib/structures/ScheduledTask';\nexport * from './lib/structures/ScheduledTaskStore';\nexport * from './lib/types/ScheduledTaskEvents';\nexport type * from './lib/types/ScheduledTaskTypes';\n\nexport { loadListeners } from './listeners/_load';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\ttasks: ScheduledTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'scheduled-tasks': ScheduledTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\ttasks: ScheduledTaskHandlerOptions;\n\t\t/**\n\t\t * If the the pre-included scheduled task error listeners should be loaded\n\t\t * @default true\n\t\t */\n\t\tloadScheduledTaskErrorListeners?: boolean;\n\t}\n}\n\n/**\n * The [@sapphire/plugin-scheduled-tasks](https://github.com/sapphiredev/plugins/blob/main/packages/scheduled-tasks) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '10.0.2-next.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;AAwCO,IAAM,OAAkB,GAAA","file":"index.mjs","sourcesContent":["import type { ScheduledTaskHandler } from './lib/ScheduledTaskHandler';\nimport type { ScheduledTaskStore } from './lib/structures/ScheduledTaskStore';\nimport type { ScheduledTaskHandlerOptions } from './lib/types/ScheduledTaskTypes';\n\nexport * from './lib/ScheduledTaskHandler';\nexport * from './lib/structures/ScheduledTask';\nexport * from './lib/structures/ScheduledTaskStore';\nexport * from './lib/types/ScheduledTaskEvents';\nexport type * from './lib/types/ScheduledTaskTypes';\n\nexport { loadListeners } from './listeners/_load';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\ttasks: ScheduledTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'scheduled-tasks': ScheduledTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\ttasks: ScheduledTaskHandlerOptions;\n\t\t/**\n\t\t * If the the pre-included scheduled task error listeners should be loaded\n\t\t * @default true\n\t\t */\n\t\tloadScheduledTaskErrorListeners?: boolean;\n\t}\n}\n\n/**\n * The [@sapphire/plugin-scheduled-tasks](https://github.com/sapphiredev/plugins/blob/main/packages/scheduled-tasks) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\n// eslint-disable-next-line @typescript-eslint/no-inferrable-types\nexport const version: string = '10.0.2-next.51af5e9';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapphire/plugin-scheduled-tasks",
|
|
3
|
-
"version": "10.0.2-next.
|
|
3
|
+
"version": "10.0.2-next.51af5e9",
|
|
4
4
|
"description": "Plugin for @sapphire/framework to have scheduled tasks",
|
|
5
5
|
"author": "@sapphire",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@sapphire/stopwatch": "^1.5.2",
|
|
53
53
|
"@sapphire/utilities": "^3.17.0",
|
|
54
|
-
"bullmq": "5.
|
|
54
|
+
"bullmq": "5.13.2"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@favware/cliff-jumper": "^4.0
|
|
57
|
+
"@favware/cliff-jumper": "^4.1.0",
|
|
58
58
|
"@favware/rollup-type-bundler": "^3.3.0",
|
|
59
|
-
"concurrently": "^
|
|
60
|
-
"tsup": "^8.
|
|
61
|
-
"tsx": "^4.
|
|
59
|
+
"concurrently": "^9.0.1",
|
|
60
|
+
"tsup": "^8.3.0",
|
|
61
|
+
"tsx": "^4.19.1",
|
|
62
62
|
"typedoc": "^0.25.13",
|
|
63
63
|
"typedoc-json-parser": "^10.0.0",
|
|
64
64
|
"typescript": "~5.4.5"
|