Discord code blocks can't have indentation

This commit is contained in:
Nuckyz 2024-06-12 19:15:26 -03:00
parent dc74d28b86
commit e0e35058fd
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -78,8 +78,8 @@ const IGNORED_DISCORD_ERRORS = [
function toCodeBlock(s: string, indentation = 0, isDiscord = false) {
s = s.replace(/```/g, "`\u200B`\u200B`");
const indentationStr = Array(indentation).fill(" ").join("");
return `\`\`\`\n${s.split("\n").map(s => indentationStr + s).join("\n")}\n${!isDiscord ? indentationStr : ""}\`\`\``;
const indentationStr = Array(!isDiscord ? indentation : 0).fill(" ").join("");
return `\`\`\`\n${s.split("\n").map(s => indentationStr + s).join("\n")}\n${indentationStr}\`\`\``;
}
async function printReport() {