3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35:02 +00:00

Add link to original case in case log channel to case embed

This commit is contained in:
Dragory 2020-08-10 03:22:57 +03:00
parent eb203a3b7a
commit 1778f95453
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 13 additions and 0 deletions

View file

@ -9,6 +9,7 @@ import { resolveCaseId } from "./resolveCaseId";
import { chunkLines, chunkMessageLines, emptyEmbedValue } from "../../../utils";
import { inGuildTz } from "../../../utils/timezones";
import { getDateFormat } from "../../../utils/dateFormats";
import { buildMessageLink } from "../../../utils/buildMessageLink";
export async function getCaseEmbed(
pluginData: PluginData<CasesPluginType>,
@ -89,5 +90,14 @@ export async function getCaseEmbed(
});
}
if (theCase.log_message_id) {
const [channelId, messageId] = theCase.log_message_id.split("-");
const link = buildMessageLink(pluginData.guild.id, channelId, messageId);
embed.fields.push({
name: emptyEmbedValue,
value: `[Go to original case in case log channel](${link})`,
});
}
return { embed };
}