mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-08 16:15:04 +00:00
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:
parent
dda19de6e6
commit
d2dd103175
28 changed files with 259 additions and 75 deletions
|
@ -1,6 +1,6 @@
|
|||
import { GuildAuditLogs } from "discord.js";
|
||||
import { userToConfigAccessibleUser } from "../../../utils/configAccessibleObjects";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { stripObjectToScalars, UnknownUser } from "../../../utils";
|
||||
import { safeFindRelevantAuditLogEntry } from "../../../utils/safeFindRelevantAuditLogEntry";
|
||||
import { logsEvt } from "../types";
|
||||
|
||||
|
@ -16,13 +16,13 @@ export const LogsGuildBanAddEvt = logsEvt({
|
|||
GuildAuditLogs.Actions.MEMBER_BAN_ADD as number,
|
||||
user.id,
|
||||
);
|
||||
const mod = relevantAuditLogEntry ? relevantAuditLogEntry.executor : new UnknownUser();
|
||||
const mod = relevantAuditLogEntry ? relevantAuditLogEntry.executor : null;
|
||||
|
||||
pluginData.state.guildLogs.log(
|
||||
LogType.MEMBER_BAN,
|
||||
{
|
||||
mod: stripObjectToScalars(mod),
|
||||
user: stripObjectToScalars(user),
|
||||
mod: mod ? userToConfigAccessibleUser(mod) : {},
|
||||
user: userToConfigAccessibleUser(user),
|
||||
},
|
||||
user.id,
|
||||
);
|
||||
|
@ -41,12 +41,12 @@ export const LogsGuildBanRemoveEvt = logsEvt({
|
|||
GuildAuditLogs.Actions.MEMBER_BAN_REMOVE as number,
|
||||
user.id,
|
||||
);
|
||||
const mod = relevantAuditLogEntry ? relevantAuditLogEntry.executor : new UnknownUser();
|
||||
const mod = relevantAuditLogEntry ? relevantAuditLogEntry.executor : null;
|
||||
|
||||
pluginData.state.guildLogs.log(
|
||||
LogType.MEMBER_UNBAN,
|
||||
{
|
||||
mod: stripObjectToScalars(mod),
|
||||
mod: mod ? userToConfigAccessibleUser(mod) : {},
|
||||
userId: user.id,
|
||||
},
|
||||
user.id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue