fix NewGuildSettings

This commit is contained in:
Vendicated 2024-06-19 16:59:40 +02:00
parent 920f326053
commit e9e789be70
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -19,10 +19,15 @@
import { definePluginSettings, migratePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { findByCodeLazy, findByPropsLazy } from "@webpack";
import { findByCodeLazy, findByPropsLazy, mapMangledModuleLazy } from "@webpack";
const { updateGuildNotificationSettings } = findByPropsLazy("updateGuildNotificationSettings");
const { toggleShowAllChannels } = findByPropsLazy("toggleShowAllChannels");
const { toggleShowAllChannels } = mapMangledModuleLazy(".onboardExistingMember(", {
toggleShowAllChannels: m => {
const s = String(m);
return s.length < 100 && !s.includes("onboardExistingMember") && !s.includes("getOptedInChannels");
}
});
const isOptInEnabledForGuild = findByCodeLazy(".COMMUNITY)||", ".isOptInEnabled(");
const settings = definePluginSettings({