3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-25 18:25:03 +00:00

Use messageLink() function for message links everywhere

This commit is contained in:
Dragory 2020-08-10 03:26:39 +03:00
parent 1778f95453
commit b379bea9b8
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
6 changed files with 19 additions and 17 deletions

View file

@ -1,6 +1,6 @@
import { PluginData } from "knub";
import { CasesPluginType } from "../types";
import { disableLinkPreviews } from "../../../utils";
import { disableLinkPreviews, messageLink } from "../../../utils";
import { DBDateFormat, getDateFormat } from "../../../utils/dateFormats";
import { CaseTypes } from "../../../data/CaseTypes";
import moment from "moment-timezone";
@ -37,7 +37,7 @@ export async function getCaseSummary(
let caseTitle = `\`Case #${theCase.case_number}\``;
if (withLinks && theCase.log_message_id) {
const [channelId, messageId] = theCase.log_message_id.split("-");
caseTitle = `[${caseTitle}](https://discord.com/channels/${pluginData.guild.id}/${channelId}/${messageId})`;
caseTitle = `[${caseTitle}](${messageLink(pluginData.guild.id, channelId, messageId)})`;
} else {
caseTitle = `\`${caseTitle}\``;
}