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

@ -6,10 +6,9 @@ import { PluginData, helpers } from "knub";
import { CasesPluginType } from "../types";
import { CaseTypeColors } from "../../../data/CaseTypeColors";
import { resolveCaseId } from "./resolveCaseId";
import { chunkLines, chunkMessageLines, emptyEmbedValue } from "../../../utils";
import { chunkLines, chunkMessageLines, emptyEmbedValue, messageLink } from "../../../utils";
import { inGuildTz } from "../../../utils/timezones";
import { getDateFormat } from "../../../utils/dateFormats";
import { buildMessageLink } from "../../../utils/buildMessageLink";
export async function getCaseEmbed(
pluginData: PluginData<CasesPluginType>,
@ -92,7 +91,7 @@ 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);
const link = messageLink(pluginData.guild.id, channelId, messageId);
embed.fields.push({
name: emptyEmbedValue,
value: `[Go to original case in case log channel](${link})`,