aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo/BushClientUtil.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/extensions/discord-akairo/BushClientUtil.ts')
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts
index 29be84c..3c3a9c4 100644
--- a/src/lib/extensions/discord-akairo/BushClientUtil.ts
+++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts
@@ -996,7 +996,8 @@ export class BushClientUtil extends ClientUtil {
return await row.save().catch((e) => client.logger.error('insertOrRemoveFromGlobal', e?.stack || e));
}
- public addOrRemoveFromArray(action: 'add' | 'remove', array: any[], value: any): any[] {
+ public addOrRemoveFromArray(action: 'add' | 'remove', _array: any[], value: any): any[] {
+ const array = new Array(..._array); // prevent modifying the original array
let newValue: any[];
if (!array) throw new Error('array is either null or undefined');
if (action === 'add') {