3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-11 04:45:02 +00:00

Use server timezone and date formats in case summaries. Link to cases in case log channel from case summaries.

This commit is contained in:
Dragory 2020-08-10 03:18:34 +03:00
parent 638f9685b1
commit eb203a3b7a
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
9 changed files with 178 additions and 62 deletions

View file

@ -3,6 +3,7 @@ import { stripObjectToScalars } from "src/utils";
import { LogType } from "src/data/LogType";
import moment from "moment-timezone";
import humanizeDuration from "humanize-duration";
import { CasesPlugin } from "../../Cases/CasesPlugin";
export const LogsGuildMemberAddEvt = logsEvent({
event: "guildMemberAdd",
@ -29,8 +30,9 @@ export const LogsGuildMemberAddEvt = logsEvent({
if (cases.length) {
const recentCaseLines = [];
const recentCases = cases.slice(0, 2);
const casesPlugin = pluginData.getPlugin(CasesPlugin);
for (const theCase of recentCases) {
recentCaseLines.push(pluginData.state.cases.getSummaryText(theCase));
recentCaseLines.push(await casesPlugin.getCaseSummary(theCase, true));
}
let recentCaseSummary = recentCaseLines.join("\n");