diff options
author | Vendicated <vendicated@riseup.net> | 2022-10-12 22:22:21 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-10-12 22:22:21 +0200 |
commit | 267b2b1a0703313311da01addafcee28100347ea (patch) | |
tree | 8e074ea220ba10d168f69b92ebc40ea608476ae7 /src/utils/misc.tsx | |
parent | 83d480a68cfed2adee18b9a6b74634644cefaacc (diff) | |
download | Vencord-267b2b1a0703313311da01addafcee28100347ea.tar.gz Vencord-267b2b1a0703313311da01addafcee28100347ea.tar.bz2 Vencord-267b2b1a0703313311da01addafcee28100347ea.zip |
Commands: basic error handling
Diffstat (limited to 'src/utils/misc.tsx')
-rw-r--r-- | src/utils/misc.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/misc.tsx b/src/utils/misc.tsx index dfeb330..b646ec1 100644 --- a/src/utils/misc.tsx +++ b/src/utils/misc.tsx @@ -157,3 +157,11 @@ export function suppressErrors<F extends Function>(name: string, func: F, thisOb } }) as any as F; } + +/** + * Wrap the text in ``` with an optional language + */ +export function makeCodeblock(text: string, language?: string) { + const chars = "```"; + return `${chars}${language || ""}\n${text}\n${chars}`; +} |