Fix message formatting

This commit is contained in:
Matheus Albino
2024-10-23 17:33:26 -03:00
parent e470722273
commit f811a5f1bb
2 changed files with 7 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
import { TextChannel, type Message } from "discord.js"; import { TextChannel, type Message } from "discord.js";
import { underline } from "../utils/message.ts"; import { italic, underline } from "../utils/message.ts";
export default function attemptReplyAuthorMessage( export default function attemptReplyAuthorMessage(
authorMessage: Message, authorMessage: Message,
@@ -16,10 +16,11 @@ export default function attemptReplyAuthorMessage(
if (!msg) return; if (!msg) return;
const { id, guildId, channelId, author } = msg; const { id, guildId, channelId, author } = msg;
if (!author.globalName) return; if (!author.globalName) return;
const messageUrl = `https://discord.com/channels/${guildId}/${channelId}/${id}`; const messageUrl = `https://discord.com/channels/${guildId}/${channelId}/${id}`;
replyMessage += `\n- Mensagem original ${++index} (por ${underline(author.globalName)}): ${messageUrl}`; replyMessage += `\n- Mensagem original ${++index} (por ${italic(author.globalName)}): ${messageUrl}`;
} }
authorMessage authorMessage

View File

@@ -27,3 +27,7 @@ export function transformMessageArrayInMap(
export function underline(message: string): string { export function underline(message: string): string {
return `__${message}__`; return `__${message}__`;
} }
export function italic(message: string): string {
return `*${message}*`;
}