From fdaf3861933247a358f3f1051460c3ead3d359c3 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Fri, 2 Apr 2021 21:31:05 +0300 Subject: [PATCH] Temp fix to role change detection on specific servers: cache all members on bot start on these server --- backend/src/plugins/Utility/UtilityPlugin.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/src/plugins/Utility/UtilityPlugin.ts b/backend/src/plugins/Utility/UtilityPlugin.ts index 0ae876ec..90c44c49 100644 --- a/backend/src/plugins/Utility/UtilityPlugin.ts +++ b/backend/src/plugins/Utility/UtilityPlugin.ts @@ -35,6 +35,7 @@ import { SnowflakeInfoCmd } from "./commands/SnowflakeInfoCmd"; import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners"; import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin"; import { VcdisconnectCmd } from "./commands/VcdisconnectCmd"; +import { refreshMembersIfNeeded } from "./refreshMembers"; const defaultOptions: PluginOptions = { config: { @@ -155,6 +156,21 @@ export const UtilityPlugin = zeppelinGuildPlugin()("utility", sendSuccessMessage(pluginData, activeReloads.get(guild.id)!, "Reloaded!"); activeReloads.delete(guild.id); } + + // FIXME: Temp fix for role change detection for specific servers, load all guild members in the background on bot start + const roleChangeDetectionFixServers = [ + "786212572285763605", + "653681924384096287", + "493351982887862283", + "513338222810497041", + "523043978178723840", + "718076393295970376", + "803251072877199400", + "750492934343753798", + ]; + if (roleChangeDetectionFixServers.includes(pluginData.guild.id)) { + refreshMembersIfNeeded(pluginData.guild); + } }, onUnload(pluginData) {