From b3af536aa9735569b8b3061f752e2b57dc65152a Mon Sep 17 00:00:00 2001 From: Huntifer Date: Sat, 24 Feb 2024 07:17:02 -0600 Subject: [PATCH] save/load + parent iteration --- commands/afkCheck.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/afkCheck.js b/commands/afkCheck.js index 4e76bbed..cb42a456 100644 --- a/commands/afkCheck.js +++ b/commands/afkCheck.js @@ -220,6 +220,7 @@ class afkCheck { leader: this.#leader, raidID: this.#raidID, members: this.members, + staffEarlyMembers: this.staffEarlyMembers, buttons: this.buttons.map(button => button.toJSON()), reactRequests: Object.fromEntries(Object.entries(this.reactRequests).map(([messageId, button]) => [messageId, {name: button.name, ...button.toJSON()}])), body: this.#body, @@ -252,6 +253,7 @@ class afkCheck { this.#raidID = storedAfkCheck.raidID this.members = storedAfkCheck.members + this.staffEarlyMembers = this.staffEarlyMembers this.buttons = storedAfkCheck.buttons.map(button => new AfkButton(this.#botSettings, this.#bot.storedEmojis, this.#guild, {...this.#afkTemplate.getButton(button.name), ...button})) this.reactRequests = Object.fromEntries(Object.entries(storedAfkCheck.reactRequests).map(([messageId, button]) => [messageId, new AfkButton(this.#botSettings, this.#bot.storedEmojis, this.#guild, {...this.#afkTemplate.getButton(button.name), ...button})])) this.#body = storedAfkCheck.body @@ -664,7 +666,7 @@ class afkCheck { } earlyLocationMembers() { - const locationButtons = this.buttons.filter(button => button.location || this.buttons.some(parent => button.parent === parent.name && parent.location)); + const locationButtons = this.buttons.filter(button => button.location || this.buttons.some(parent => button.parent?.includes(parent.name) && parent.location)); return locationButtons.map(button => button.members).flat() }