all repos — stealth-developers @ 9b885fe8c0d7c22dd2e256a7f9db5bafcf9bdc4d

src/utils/tickets/formatting.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
import type { Interaction } from "discord.js";

export function formatMessage(message: string, user: string): string {
	const templates: Record<string, string> = {
		"{user}": `<@${user}>`,
	};

	return Object.entries(templates).reduce(
		(msg, [key, val]) => msg.split(key).join(val),
		message,
	);
}