@open-discord-bots/framework 0.2.15 → 0.2.16

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 CHANGED
@@ -42,7 +42,7 @@ export class ODMain {
42
42
  constructor(managers, project) {
43
43
  this.project = project;
44
44
  this.versions = managers.versions;
45
- this.versions.add(ODVersion.fromString("opendiscord:api", "v0.2.15"));
45
+ this.versions.add(ODVersion.fromString("opendiscord:api", "v0.2.16"));
46
46
  this.versions.add(ODVersion.fromString("opendiscord:livestatus", "v2.0.0"));
47
47
  this.debugfile = managers.debugfile;
48
48
  this.console = managers.console;
@@ -593,6 +593,8 @@ export interface ODCheckerEnabledObjectStructureOptions extends ODCheckerStructu
593
593
  enabledValue: boolean | string | number;
594
594
  /**The object checker to use once the property has been matched. */
595
595
  checker: ODCheckerObjectStructure;
596
+ /**Ignore the `checker` if the object is disabled (`property` doesn't match `enabledValue`) */
597
+ ignoreCheckIfDisabled: boolean;
596
598
  }
597
599
  /**## ODCheckerEnabledObjectStructure `class`
598
600
  * This is an Open Discord config checker structure.
@@ -1071,7 +1071,10 @@ export class ODCheckerEnabledObjectStructure extends ODCheckerStructure {
1071
1071
  //this object is disabled
1072
1072
  if (this.options.property)
1073
1073
  checker.createMessage("opendiscord:object-disabled", "info", `This object is disabled, enable it using "${this.options.property}"!`, lt, null, [`"${this.options.property}"`], this.id, (this.options.docs ?? null));
1074
- return super.check(checker, value, locationTrace);
1074
+ if (this.options.checker && !this.options.ignoreCheckIfDisabled)
1075
+ return this.options.checker.check(checker, value, lt);
1076
+ else
1077
+ return super.check(checker, value, locationTrace);
1075
1078
  }
1076
1079
  }
1077
1080
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@open-discord-bots/framework",
3
3
  "author": "DJj123dj",
4
- "version": "0.2.15",
4
+ "version": "0.2.16",
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
@@ -142,7 +142,7 @@ export class ODMain implements ODMainManagers {
142
142
  constructor(managers:ODMainManagers,project:ODProjectType){
143
143
  this.project = project
144
144
  this.versions = managers.versions
145
- this.versions.add(ODVersion.fromString("opendiscord:api","v0.2.15"))
145
+ this.versions.add(ODVersion.fromString("opendiscord:api","v0.2.16"))
146
146
  this.versions.add(ODVersion.fromString("opendiscord:livestatus","v2.0.0"))
147
147
 
148
148
  this.debugfile = managers.debugfile
@@ -1366,7 +1366,9 @@ export interface ODCheckerEnabledObjectStructureOptions extends ODCheckerStructu
1366
1366
  /**The value of the property to be enabled. (e.g. `true`) */
1367
1367
  enabledValue:boolean|string|number,
1368
1368
  /**The object checker to use once the property has been matched. */
1369
- checker:ODCheckerObjectStructure
1369
+ checker:ODCheckerObjectStructure,
1370
+ /**Ignore the `checker` if the object is disabled (`property` doesn't match `enabledValue`) */
1371
+ ignoreCheckIfDisabled:boolean
1370
1372
  }
1371
1373
 
1372
1374
  /**## ODCheckerEnabledObjectStructure `class`
@@ -1402,7 +1404,8 @@ export class ODCheckerEnabledObjectStructure extends ODCheckerStructure {
1402
1404
  }else{
1403
1405
  //this object is disabled
1404
1406
  if (this.options.property) checker.createMessage("opendiscord:object-disabled","info",`This object is disabled, enable it using "${this.options.property}"!`,lt,null,[`"${this.options.property}"`],this.id,(this.options.docs ?? null))
1405
- return super.check(checker,value,locationTrace)
1407
+ if (this.options.checker && !this.options.ignoreCheckIfDisabled) return this.options.checker.check(checker,value,lt)
1408
+ else return super.check(checker,value,locationTrace)
1406
1409
  }
1407
1410
  }
1408
1411
  }