mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25: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:
parent
638f9685b1
commit
eb203a3b7a
9 changed files with 178 additions and 62 deletions
|
@ -21,6 +21,7 @@ import { getLogMessage } from "./util/getLogMessage";
|
|||
import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
|
||||
import { disableCodeBlocks } from "../../utils";
|
||||
import { logger } from "../../logger";
|
||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||
|
||||
const defaultOptions: PluginOptions<LogsPluginType> = {
|
||||
config: {
|
||||
|
@ -48,6 +49,7 @@ export const LogsPlugin = zeppelinPlugin<LogsPluginType>()("logs", {
|
|||
prettyName: "Logs",
|
||||
},
|
||||
|
||||
dependencies: [CasesPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue