mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 14:13:01 -04:00
Improve SupportHelper
- improve update check when entering support channel - add "Run Snippet" button to venbot messages with codeblock - add "Send /vencord-debug" button to messages that contain /vencord-debug - add "Update Now" button to messages by venbot and in #known-issues that contain "update" - add some common issues like RPC disabled / NoRPC enabled to /vencord-debug - split plugin list into separate /vencord-plugins command to reduce size & avoid >2000 chars errors
This commit is contained in:
parent
7dc1d4c498
commit
b9392c3be2
3 changed files with 233 additions and 73 deletions
|
@ -131,3 +131,18 @@ export function makeCodeblock(text: string, language?: string) {
|
|||
const chars = "```";
|
||||
return `${chars}${language || ""}\n${text.replaceAll("```", "\\`\\`\\`")}\n${chars}`;
|
||||
}
|
||||
|
||||
export function stripIndent(strings: TemplateStringsArray, ...values: any[]) {
|
||||
const string = String.raw({ raw: strings }, ...values);
|
||||
|
||||
const match = string.match(/^[ \t]*(?=\S)/gm);
|
||||
if (!match) return string.trim();
|
||||
|
||||
const minIndent = match.reduce((r, a) => Math.min(r, a.length), Infinity);
|
||||
return string.replace(new RegExp(`^[ \\t]{${minIndent}}`, "gm"), "").trim();
|
||||
}
|
||||
|
||||
export const ZWSP = "\u200b";
|
||||
export function toInlineCode(s: string) {
|
||||
return "``" + ZWSP + s.replaceAll("`", ZWSP + "`" + ZWSP) + ZWSP + "``";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue