3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 22:01:50 +00:00

Fix unnecessary 'go to original case' links in case log channel

This commit is contained in:
Dragory 2021-05-22 14:01:00 +03:00
parent b4fb6de86e
commit eed4fd586b
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 3 additions and 2 deletions
backend/src/plugins/Cases/functions

View file

@ -13,6 +13,7 @@ export async function getCaseEmbed(
pluginData: GuildPluginData<CasesPluginType>,
caseOrCaseId: Case | number,
requestMemberId?: string,
noOriginalCaseLink?: boolean,
): Promise<AdvancedMessageContent> {
const theCase = await pluginData.state.cases.with("notes").find(resolveCaseId(caseOrCaseId));
if (!theCase) {
@ -98,7 +99,7 @@ export async function getCaseEmbed(
});
}
if (theCase.log_message_id) {
if (theCase.log_message_id && noOriginalCaseLink !== false) {
const [channelId, messageId] = theCase.log_message_id.split("-");
const link = messageLink(pluginData.guild.id, channelId, messageId);
embed.fields.push({

View file

@ -43,7 +43,7 @@ export async function postCaseToCaseLogChannel(
const theCase = await pluginData.state.cases.find(resolveCaseId(caseOrCaseId));
if (!theCase) return null;
const caseEmbed = await getCaseEmbed(pluginData, caseOrCaseId);
const caseEmbed = await getCaseEmbed(pluginData, caseOrCaseId, undefined, true);
if (!caseEmbed) return null;
if (theCase.log_message_id) {