diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-14 21:43:24 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-14 21:43:24 -0400 |
commit | 82b7fdf99ba4ad50ca037ff11c8fd2d386c45e71 (patch) | |
tree | 87c9815a60c64503af623b20bc42e814ef4a73c4 /src/lib/common/util | |
parent | 0c45d2739fafd1f7b93c2a826a00a81356be0c71 (diff) | |
download | tanzanite-82b7fdf99ba4ad50ca037ff11c8fd2d386c45e71.tar.gz tanzanite-82b7fdf99ba4ad50ca037ff11c8fd2d386c45e71.tar.bz2 tanzanite-82b7fdf99ba4ad50ca037ff11c8fd2d386c45e71.zip |
add mylogs command - view your own modlogs
Diffstat (limited to 'src/lib/common/util')
-rw-r--r-- | src/lib/common/util/Format.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/common/util/Format.ts b/src/lib/common/util/Format.ts index ff34745..debaf4b 100644 --- a/src/lib/common/util/Format.ts +++ b/src/lib/common/util/Format.ts @@ -88,7 +88,7 @@ export function spoiler(content: string): string { * @param text The input */ export function input(text: string): string { - return bold(escapeMarkdown(sanitizeWtlAndControl(`${text}`))); + return bold(sanitizeInputForDiscord(`${text}`)); } /** @@ -108,4 +108,12 @@ export function sanitizeWtlAndControl(str: string) { return `${str}`.replace(/[\u0000-\u001F\u007F-\u009F\u200B]/g, ''); } +/** + * Removed wtl and control characters and escapes any other markdown + * @param text The input + */ +export function sanitizeInputForDiscord(text: string): string { + return escapeMarkdown(sanitizeWtlAndControl(`${text}`)); +} + export { escapeMarkdown } from 'discord.js'; |