From 18c3f9e34dfc7d3b8b160f1007928230d65bea6c Mon Sep 17 00:00:00 2001 From: Faf4a <87046111+Faf4a@users.noreply.github.com> Date: Sun, 3 Dec 2023 07:24:13 +0100 Subject: [PATCH 1/3] feat: disableAoiDB --- src/classes/AoiBase.js | 9 +-------- src/handler/AoiStart.js | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/classes/AoiBase.js b/src/classes/AoiBase.js index 6a24da47d..df07b36b9 100644 --- a/src/classes/AoiBase.js +++ b/src/classes/AoiBase.js @@ -48,10 +48,7 @@ class BaseClient extends Discord.Client { this.variableManager = new VariableManager(this); - if ( - ["default", "aoi.db"].includes(options?.database?.type) || - !options?.database - ) { + if (options.disableAoiDB === true && (["default", "aoi.db"].includes(options?.database?.type) || !options?.database)) { const dbData = options?.database; this.db = new Database( @@ -135,10 +132,6 @@ class BaseClient extends Discord.Client { } } - /** - * @param {Record} d - * @param table - */ variables(d, table = this.db?.tables?.[0]) { if (this.db === undefined) { throw new TypeError( diff --git a/src/handler/AoiStart.js b/src/handler/AoiStart.js index e343fcb6d..b947aaec9 100644 --- a/src/handler/AoiStart.js +++ b/src/handler/AoiStart.js @@ -13,7 +13,7 @@ module.exports = async (client, options) => { await require("./AoiAutoUpdate.js")(client); } - if (client.aoiOptions.database && client.aoiOptions.database) { + if (client.aoiOptions.disableAoiDB === true && client.aoiOptions.database && client.aoiOptions.database) { await require("./Custom/timeout.js")( { client, interpreter: Interpreter }, undefined, From dbb358d1cb662dcce7b111bb543329e07134f479 Mon Sep 17 00:00:00 2001 From: Faf4a <87046111+Faf4a@users.noreply.github.com> Date: Sun, 3 Dec 2023 07:25:30 +0100 Subject: [PATCH 2/3] types --- src/classes/AoiBase.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/classes/AoiBase.js b/src/classes/AoiBase.js index df07b36b9..21c7aaf38 100644 --- a/src/classes/AoiBase.js +++ b/src/classes/AoiBase.js @@ -132,6 +132,12 @@ class BaseClient extends Discord.Client { } } + /** + * Adds variables to the variable manager. + * @param {Object} d - The object containing the variables to be added. + * @param {Object} [table=this.db?.tables?.[0]] - The table to which the variables belong. + * @throws {TypeError} If a database is not provided. + */ variables(d, table = this.db?.tables?.[0]) { if (this.db === undefined) { throw new TypeError( From 2cedf1a90f0c25e5dd8414cc4fa77de7ca8c4434 Mon Sep 17 00:00:00 2001 From: Faf4a <87046111+Faf4a@users.noreply.github.com> Date: Sun, 3 Dec 2023 07:26:15 +0100 Subject: [PATCH 3/3] types --- src/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.d.ts b/src/index.d.ts index 9ef515dba..dfc1d07b8 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -191,6 +191,7 @@ declare module "aoi.js" { aoiLogs?: boolean; aoiWarning?: boolean; aoiAutoUpdate?: boolean; + disableAoiDB: boolean; suppressAllErrors?: boolean; errorMessage?: Array; events?: Array;