Start move to configAccessibleObjects, exclude perm overrides from logs

configAccessibleObjects are used to guarantee backwards compatibility and consistency.
Perm overrides from our own plugins are ignored as to not spam logs through bot managed slowmode or companion channels
This commit is contained in:
Dark 2021-07-06 05:23:47 +02:00
parent dda19de6e6
commit d2dd103175
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8
28 changed files with 259 additions and 75 deletions

View file

@ -35,7 +35,7 @@ import { SourceCmd } from "./commands/SourceCmd";
import { UserInfoCmd } from "./commands/UserInfoCmd";
import { VcdisconnectCmd } from "./commands/VcdisconnectCmd";
import { VcmoveAllCmd, VcmoveCmd } from "./commands/VcmoveCmd";
import { AutoJoinThreadEvt } from "./events/AutoJoinThreadEvt";
import { AutoJoinThreadEvt, AutoJoinThreadSyncEvt } from "./events/AutoJoinThreadEvt";
import { activeReloads } from "./guildReloads";
import { refreshMembersIfNeeded } from "./refreshMembers";
import { ConfigSchema, UtilityPluginType } from "./types";
@ -153,6 +153,7 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()({
// prettier-ignore
events: [
AutoJoinThreadEvt,
AutoJoinThreadSyncEvt,
],
beforeLoad(pluginData) {

View file

@ -10,3 +10,18 @@ export const AutoJoinThreadEvt = utilityEvt({
}
},
});
export const AutoJoinThreadSyncEvt = utilityEvt({
event: "threadListSync",
async listener(meta) {
const config = meta.pluginData.config.get();
if (config.autojoin_threads) {
for (const thread of meta.args.threads.values()) {
if (!thread.joined && thread.joinable) {
await thread.join();
}
}
}
},
});

View file

@ -126,7 +126,7 @@ export async function getServerInfoEmbed(
}
if (!onlineMemberCount && thisServer) {
onlineMemberCount = thisServer.members.cache.filter(m => m.presence.status !== "offline").size; // Extremely inaccurate fallback
onlineMemberCount = thisServer.members.cache.filter(m => m.presence?.status !== "offline").size; // Extremely inaccurate fallback
}
const offlineMemberCount = totalMembers - onlineMemberCount;