mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-08 16:15:04 +00:00
More rework progress, mostly done up to ModActions
This commit is contained in:
parent
52839cc9f3
commit
57893e7f76
38 changed files with 199 additions and 241 deletions
|
@ -3,20 +3,21 @@ import { stripObjectToScalars, UnknownUser } from "../../../utils";
|
|||
import { LogType } from "../../../data/LogType";
|
||||
|
||||
import { safeFindRelevantAuditLogEntry } from "../../../utils/safeFindRelevantAuditLogEntry";
|
||||
import { GuildAuditLogs } from "discord.js";
|
||||
|
||||
export const LogsGuildBanAddEvt = logsEvt({
|
||||
event: "guildBanAdd",
|
||||
|
||||
async listener(meta) {
|
||||
const pluginData = meta.pluginData;
|
||||
const user = meta.args.user;
|
||||
const user = meta.args.ban.user;
|
||||
|
||||
const relevantAuditLogEntry = await safeFindRelevantAuditLogEntry(
|
||||
pluginData,
|
||||
ErisConstants.AuditLogActions.MEMBER_BAN_ADD,
|
||||
GuildAuditLogs.Actions.MEMBER_BAN_ADD as number,
|
||||
user.id,
|
||||
);
|
||||
const mod = relevantAuditLogEntry ? relevantAuditLogEntry.user : new UnknownUser();
|
||||
const mod = relevantAuditLogEntry ? relevantAuditLogEntry.executor : new UnknownUser();
|
||||
|
||||
pluginData.state.guildLogs.log(
|
||||
LogType.MEMBER_BAN,
|
||||
|
@ -34,14 +35,14 @@ export const LogsGuildBanRemoveEvt = logsEvt({
|
|||
|
||||
async listener(meta) {
|
||||
const pluginData = meta.pluginData;
|
||||
const user = meta.args.user;
|
||||
const user = meta.args.ban.user;
|
||||
|
||||
const relevantAuditLogEntry = await safeFindRelevantAuditLogEntry(
|
||||
pluginData,
|
||||
ErisConstants.AuditLogActions.MEMBER_BAN_REMOVE,
|
||||
GuildAuditLogs.Actions.MEMBER_BAN_REMOVE as number,
|
||||
user.id,
|
||||
);
|
||||
const mod = relevantAuditLogEntry ? relevantAuditLogEntry.user : new UnknownUser();
|
||||
const mod = relevantAuditLogEntry ? relevantAuditLogEntry.executor : new UnknownUser();
|
||||
|
||||
pluginData.state.guildLogs.log(
|
||||
LogType.MEMBER_UNBAN,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue