@open-discord-bots/framework 0.3.6 → 0.3.7
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/dist/api/main.js +1 -1
- package/dist/api/modules/state.d.ts +6 -6
- package/package.json +1 -1
- package/src/api/main.ts +1 -1
- package/src/api/modules/state.ts +8 -8
package/dist/api/main.js
CHANGED
|
@@ -44,7 +44,7 @@ export class ODMain {
|
|
|
44
44
|
constructor(managers, project) {
|
|
45
45
|
this.project = project;
|
|
46
46
|
this.versions = managers.versions;
|
|
47
|
-
this.versions.add(ODVersion.fromString("opendiscord:api", "v0.3.
|
|
47
|
+
this.versions.add(ODVersion.fromString("opendiscord:api", "v0.3.7"));
|
|
48
48
|
this.versions.add(ODVersion.fromString("opendiscord:livestatus", "v2.0.0"));
|
|
49
49
|
this.debugfile = managers.debugfile;
|
|
50
50
|
this.console = managers.console;
|
|
@@ -67,7 +67,7 @@ export interface ODStateSettings {
|
|
|
67
67
|
*
|
|
68
68
|
* Features automatic garbage collection to clear expired states.
|
|
69
69
|
*/
|
|
70
|
-
export declare class ODState<StateData extends any, WithGuildKey extends boolean
|
|
70
|
+
export declare class ODState<StateData extends any, WithGuildKey extends boolean, WithUserKey extends boolean> extends ODManagerData {
|
|
71
71
|
/**Alias to Open Discord message states database. */
|
|
72
72
|
protected database: ODDatabase<ODDatabaseIdConstraint>;
|
|
73
73
|
/**Alias to Open Discord client manager. */
|
|
@@ -108,21 +108,21 @@ export declare class ODState<StateData extends any, WithGuildKey extends boolean
|
|
|
108
108
|
/**## ODStateManagerIdConstraint `type`
|
|
109
109
|
* The constraint/layout for id mappings/interfaces of the `ODStateManager` class.
|
|
110
110
|
*/
|
|
111
|
-
export type ODStateManagerIdConstraint = Record<string, ODState<any>>;
|
|
111
|
+
export type ODStateManagerIdConstraint = Record<string, ODState<any, boolean, boolean>>;
|
|
112
112
|
/**## ODStateManager `class`
|
|
113
113
|
* The Open Discord state manager is a system for tracking messages or linking metadata, states or progress to Discord messages (ID-based).
|
|
114
114
|
*
|
|
115
115
|
* Features automatic garbage collection to clear expired states.
|
|
116
116
|
*/
|
|
117
|
-
export declare class ODStateManager<IdList extends ODStateManagerIdConstraint = ODStateManagerIdConstraint> extends ODManager<ODState<any>> {
|
|
117
|
+
export declare class ODStateManager<IdList extends ODStateManagerIdConstraint = ODStateManagerIdConstraint> extends ODManager<ODState<any, boolean, boolean>> {
|
|
118
118
|
constructor(debug: ODDebugger);
|
|
119
119
|
/**Init all states. */
|
|
120
120
|
init(): Promise<void>;
|
|
121
|
-
add(data: ODState<any>, overwrite?: boolean): boolean;
|
|
121
|
+
add(data: ODState<any, boolean, boolean>, overwrite?: boolean): boolean;
|
|
122
122
|
get<StateId extends keyof ODNoGeneric<IdList>>(id: StateId): IdList[StateId];
|
|
123
|
-
get(id: ODValidId): ODState<any> | null;
|
|
123
|
+
get(id: ODValidId): ODState<any, boolean, boolean> | null;
|
|
124
124
|
remove<StateId extends keyof ODNoGeneric<IdList>>(id: StateId): IdList[StateId];
|
|
125
|
-
remove(id: ODValidId): ODState<any> | null;
|
|
125
|
+
remove(id: ODValidId): ODState<any, boolean, boolean> | null;
|
|
126
126
|
exists(id: keyof ODNoGeneric<IdList>): boolean;
|
|
127
127
|
exists(id: ODValidId): boolean;
|
|
128
128
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-discord-bots/framework",
|
|
3
3
|
"author": "DJj123dj",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.7",
|
|
5
5
|
"description": "The core framework of the popular open-source discord bots: Open Ticket & Open Moderation.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
package/src/api/main.ts
CHANGED
|
@@ -154,7 +154,7 @@ export abstract class ODMain implements ODMainManagers {
|
|
|
154
154
|
constructor(managers:ODMainManagers,project:ODProjectType){
|
|
155
155
|
this.project = project
|
|
156
156
|
this.versions = managers.versions
|
|
157
|
-
this.versions.add(ODVersion.fromString("opendiscord:api","v0.3.
|
|
157
|
+
this.versions.add(ODVersion.fromString("opendiscord:api","v0.3.7"))
|
|
158
158
|
this.versions.add(ODVersion.fromString("opendiscord:livestatus","v2.0.0"))
|
|
159
159
|
|
|
160
160
|
this.debugfile = managers.debugfile
|
package/src/api/modules/state.ts
CHANGED
|
@@ -73,7 +73,7 @@ export interface ODStateSettings {
|
|
|
73
73
|
*
|
|
74
74
|
* Features automatic garbage collection to clear expired states.
|
|
75
75
|
*/
|
|
76
|
-
export class ODState<StateData extends any,WithGuildKey extends boolean
|
|
76
|
+
export class ODState<StateData extends any,WithGuildKey extends boolean,WithUserKey extends boolean> extends ODManagerData {
|
|
77
77
|
/**Alias to Open Discord message states database. */
|
|
78
78
|
protected database: ODDatabase<ODDatabaseIdConstraint>
|
|
79
79
|
/**Alias to Open Discord client manager. */
|
|
@@ -251,14 +251,14 @@ export class ODState<StateData extends any,WithGuildKey extends boolean = true,W
|
|
|
251
251
|
/**## ODStateManagerIdConstraint `type`
|
|
252
252
|
* The constraint/layout for id mappings/interfaces of the `ODStateManager` class.
|
|
253
253
|
*/
|
|
254
|
-
export type ODStateManagerIdConstraint = Record<string,ODState<any>>
|
|
254
|
+
export type ODStateManagerIdConstraint = Record<string,ODState<any,boolean,boolean>>
|
|
255
255
|
|
|
256
256
|
/**## ODStateManager `class`
|
|
257
257
|
* The Open Discord state manager is a system for tracking messages or linking metadata, states or progress to Discord messages (ID-based).
|
|
258
258
|
*
|
|
259
259
|
* Features automatic garbage collection to clear expired states.
|
|
260
260
|
*/
|
|
261
|
-
export class ODStateManager<IdList extends ODStateManagerIdConstraint = ODStateManagerIdConstraint> extends ODManager<ODState<any>> {
|
|
261
|
+
export class ODStateManager<IdList extends ODStateManagerIdConstraint = ODStateManagerIdConstraint> extends ODManager<ODState<any,boolean,boolean>> {
|
|
262
262
|
constructor(debug:ODDebugger){
|
|
263
263
|
super(debug,"state")
|
|
264
264
|
}
|
|
@@ -270,22 +270,22 @@ export class ODStateManager<IdList extends ODStateManagerIdConstraint = ODStateM
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
add(data:ODState<any>, overwrite?:boolean): boolean {
|
|
273
|
+
add(data:ODState<any,boolean,boolean>, overwrite?:boolean): boolean {
|
|
274
274
|
data.useDebug(this.debug)
|
|
275
275
|
return super.add(data,overwrite)
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
get<StateId extends keyof ODNoGeneric<IdList>>(id:StateId): IdList[StateId]
|
|
279
|
-
get(id:ODValidId): ODState<any>|null
|
|
279
|
+
get(id:ODValidId): ODState<any,boolean,boolean>|null
|
|
280
280
|
|
|
281
|
-
get(id:ODValidId): ODState<any>|null {
|
|
281
|
+
get(id:ODValidId): ODState<any,boolean,boolean>|null {
|
|
282
282
|
return super.get(id)
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
remove<StateId extends keyof ODNoGeneric<IdList>>(id:StateId): IdList[StateId]
|
|
286
|
-
remove(id:ODValidId): ODState<any>|null
|
|
286
|
+
remove(id:ODValidId): ODState<any,boolean,boolean>|null
|
|
287
287
|
|
|
288
|
-
remove(id:ODValidId): ODState<any>|null {
|
|
288
|
+
remove(id:ODValidId): ODState<any,boolean,boolean>|null {
|
|
289
289
|
return super.remove(id)
|
|
290
290
|
}
|
|
291
291
|
|