Add missing logtypes, add change visualization
This commit is contained in:
parent
144c9c43e0
commit
968889e529
8 changed files with 80 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
import { LogType } from "../../../data/LogType";
|
||||
import { stripObjectToScalars } from "../../../utils";
|
||||
import { stripObjectToScalars, getScalarDifference, differenceToString } from "../../../utils";
|
||||
import { logsEvt } from "../types";
|
||||
|
||||
export const LogsThreadCreateEvt = logsEvt({
|
||||
|
@ -26,9 +26,13 @@ export const LogsThreadUpdateEvt = logsEvt({
|
|||
event: "threadUpdate",
|
||||
|
||||
async listener(meta) {
|
||||
const diff = getScalarDifference(meta.args.oldThread, meta.args.newThread, ["messageCount", "archiveTimestamp"]);
|
||||
const differenceString = differenceToString(diff);
|
||||
|
||||
meta.pluginData.state.guildLogs.log(LogType.THREAD_UPDATE, {
|
||||
oldThread: stripObjectToScalars(meta.args.oldThread),
|
||||
newThread: stripObjectToScalars(meta.args.newThread),
|
||||
differenceString,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue