3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-19 07:20:00 +00:00
zeppelin/backend/src/plugins/Logs/events/LogsThreadModifyEvts.ts

35 lines
905 B
TypeScript
Raw Normal View History

2021-07-01 02:21:16 +02:00
import { LogType } from "../../../data/LogType";
import { stripObjectToScalars } from "../../../utils";
import { logsEvt } from "../types";
export const LogsThreadCreateEvt = logsEvt({
event: "threadCreate",
async listener(meta) {
meta.pluginData.state.guildLogs.log(LogType.THREAD_CREATE, {
thread: stripObjectToScalars(meta.args.thread),
});
},
});
export const LogsThreadDeleteEvt = logsEvt({
event: "threadDelete",
async listener(meta) {
meta.pluginData.state.guildLogs.log(LogType.THREAD_DELETE, {
thread: stripObjectToScalars(meta.args.thread),
});
},
});
export const LogsThreadUpdateEvt = logsEvt({
event: "threadUpdate",
async listener(meta) {
meta.pluginData.state.guildLogs.log(LogType.THREAD_UPDATE, {
oldThread: stripObjectToScalars(meta.args.oldThread),
newThread: stripObjectToScalars(meta.args.newThread),
});
},
});