3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-14 22:05:01 +00:00

Merge remote-tracking branch 'origin/master' into iots_to_zod

This commit is contained in:
Dragory 2024-01-27 14:12:06 +02:00
commit 59c5176cbd
No known key found for this signature in database
39 changed files with 1420 additions and 2208 deletions

View file

@ -2,7 +2,6 @@ import { PluginOptions } from "knub";
import { GuildLogs } from "../../data/GuildLogs";
import { GuildPersistedData } from "../../data/GuildPersistedData";
import { trimPluginDescription } from "../../utils";
import { GuildMemberCachePlugin } from "../GuildMemberCache/GuildMemberCachePlugin";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
@ -30,7 +29,7 @@ export const PersistPlugin = zeppelinGuildPlugin<PersistPluginType>()({
configSchema: zPersistConfig,
},
dependencies: () => [LogsPlugin, RoleManagerPlugin, GuildMemberCachePlugin],
dependencies: () => [LogsPlugin, RoleManagerPlugin],
configParser: (input) => zPersistConfig.parse(input),
defaultOptions,

View file

@ -1,5 +1,4 @@
import { PersistedData } from "../../../data/entities/PersistedData";
import { GuildMemberCachePlugin } from "../../GuildMemberCache/GuildMemberCachePlugin";
import { persistEvt } from "../types";
export const StoreDataEvt = persistEvt({
@ -9,8 +8,11 @@ export const StoreDataEvt = persistEvt({
const config = await pluginData.config.getForUser(member.user);
const persistData: Partial<PersistedData> = {};
// FIXME: New caching thing, or fix deadlocks with this plugin
if (member.partial) {
return;
// Djs hasn't cached member data => use db cache
/*
const data = await pluginData.getPlugin(GuildMemberCachePlugin).getCachedMemberData(member.id);
if (!data) {
return;
@ -22,7 +24,7 @@ export const StoreDataEvt = persistEvt({
}
if (config.persist_nicknames && data.nickname) {
persistData.nickname = data.nickname;
}
}*/
} else {
// Djs has cached member data => use that
const memberRoles = Array.from(member.roles.cache.keys());