0
0
Fork 0

Update the command to parse the new return type and escape Discord markdown

This commit is contained in:
Oliver-Akins 2023-02-24 08:30:28 -07:00
parent 256bce6abc
commit 7951484514
2 changed files with 40 additions and 3 deletions

8
src/utils/markdown.ts Normal file
View file

@ -0,0 +1,8 @@
export function escapeDiscordMarkdown(message: string) {
let m = message;
m = m.replace(/_/gi, `\_`);
m = m.replace(/\*/gi, `\*`);
m = m.replace(/~/gi, `\~`);
m = m.replace(/||/gi, `\||`);
return m;
};