Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disableAoiDB #507

Merged
merged 3 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 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 === true && (["default", "aoi.db"].includes(options?.database?.type) || !options?.database)) {
const dbData = options?.database;

this.db = new Database(
Expand Down Expand Up @@ -136,8 +133,10 @@ class BaseClient extends Discord.Client {
}

/**
* @param {Record<string,string | number | object >} d
* @param table
* 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) {
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 === true && 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
Loading