Skip to content

Commit

Permalink
Merge pull request #505 from Faf4a/v6
Browse files Browse the repository at this point in the history
feat: disableaoidb
  • Loading branch information
Leref authored Dec 3, 2023
2 parents 7e3136f + ba4706a commit ce5d991
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
12 changes: 4 additions & 8 deletions src/classes/AoiBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 && (["default", "aoi.db"].includes(options?.database?.type) || !options?.database)) {
const dbData = options?.database;

this.db = new Database(
Expand Down Expand Up @@ -134,11 +131,10 @@ class BaseClient extends Discord.Client {
});
}
}

/**
* @param {Record<string,string | number | object >} d
* @param table
*/
* @param {Record<string,string | number | object >} d
* @param table
*/
variables(d, table = this.db?.tables?.[0]) {
if (this.db === undefined) {
throw new TypeError(
Expand Down
1 change: 1 addition & 0 deletions src/functions/event/shard.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = async (d) => {
const data = d.util.aoiFunc(d);
if (data.err) return d.error(data.err);

const [option] = data.inside.splits;

Expand Down
2 changes: 1 addition & 1 deletion src/handler/AoiStart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 && client.aoiOptions.database && client.aoiOptions.database) {
await require("./Custom/timeout.js")(
{ client, interpreter: Interpreter },
undefined,
Expand Down
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ declare module "aoi.js" {
aoiLogs?: boolean;
aoiWarning?: boolean;
aoiAutoUpdate?: boolean;
disableAoiDB?: boolean;
suppressAllErrors?: boolean;
errorMessage?: Array<string>;
events?: Array<AllEvents>;
Expand Down

0 comments on commit ce5d991

Please sign in to comment.