aboutsummaryrefslogtreecommitdiff
path: root/src/utils/misc.tsx
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-10-12 22:22:21 +0200
committerVendicated <vendicated@riseup.net>2022-10-12 22:22:21 +0200
commit267b2b1a0703313311da01addafcee28100347ea (patch)
tree8e074ea220ba10d168f69b92ebc40ea608476ae7 /src/utils/misc.tsx
parent83d480a68cfed2adee18b9a6b74634644cefaacc (diff)
downloadVencord-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.tsx8
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}`;
+}