aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/extensions/discord-akairo')
-rw-r--r--src/lib/extensions/discord-akairo/BushClient.ts8
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts4
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts
index 65b60eb..cb1e50b 100644
--- a/src/lib/extensions/discord-akairo/BushClient.ts
+++ b/src/lib/extensions/discord-akairo/BushClient.ts
@@ -419,7 +419,11 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
Stat.initModel(this.sharedDB);
Global.initModel(this.sharedDB);
Shared.initModel(this.sharedDB);
- await this.sharedDB.sync({ alter: true }); // Sync all tables to fix everything if updated
+ await this.sharedDB.sync({
+ // Sync all tables to fix everything if updated
+ // if another instance restarts we don't want to overwrite new changes made in development
+ alter: this.config.isDevelopment ? true : false
+ });
await this.console.success('startup', `Successfully connected to <<shared database>>.`, false);
} catch (e) {
await this.console.error(
@@ -473,7 +477,7 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
public override isSuperUser(user: BushUserResolvable): boolean {
const userID = this.users.resolveId(user)!;
- return !!client.cache.shared.superUsers.includes(userID) || this.config.owners.includes(userID);
+ return client.cache.shared.superUsers.includes(userID) || this.config.owners.includes(userID);
}
}
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts
index cdb883d..3e066c8 100644
--- a/src/lib/extensions/discord-akairo/BushClientUtil.ts
+++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts
@@ -476,7 +476,7 @@ export class BushClientUtil extends ClientUtil {
* @param key The key of the element in the shared cache to update.
* @param value The value to add/remove from the array.
*/
- public async insertOrRemoveFromShared<K extends keyof typeof client['cache']['shared']>(
+ public async insertOrRemoveFromShared<K extends Exclude<keyof typeof client['cache']['shared'], 'badWords'>>(
action: 'add' | 'remove',
key: K,
value: typeof client['cache']['shared'][K][0]
@@ -510,7 +510,7 @@ export class BushClientUtil extends ClientUtil {
* @param key The key in the shared cache to update.
* @param value The value to set the key to.
*/
- public async setShared<K extends keyof typeof client['cache']['shared']>(
+ public async setShared<K extends Exclude<keyof typeof client['cache']['shared'], 'badWords'>>(
key: K,
value: typeof client['cache']['shared'][K]
): Promise<Shared | void> {