feat: use rs for formatting zig files

This commit is contained in:
Jozef Steinhübl 2023-10-02 22:09:00 +02:00
parent d08964c2cf
commit 9af4671f43
No known key found for this signature in database
GPG key ID: E944BC293F5FF7E7

View file

@ -47,7 +47,7 @@ async function handleGithubLink(message: Message) {
const repo = groups.repo; const repo = groups.repo;
const path = groups.path; const path = groups.path;
const extension = extname(path).slice(1); let extension = extname(path).slice(1);
const firstLineNumber = parseInt(groups.first_line_number) - 1; const firstLineNumber = parseInt(groups.first_line_number) - 1;
const secondLineNumber = parseInt(groups.second_line_number) || firstLineNumber + 1; const secondLineNumber = parseInt(groups.second_line_number) || firstLineNumber + 1;
@ -74,6 +74,8 @@ async function handleGithubLink(message: Message) {
// delete the last \n // delete the last \n
text = text.slice(0, -1); text = text.slice(0, -1);
if (extension === "zig") extension = "rs";
message.reply({ message.reply({
content: `\`\`\`${extension}\n${safeSlice(text, 2000 - 6 - extension.length)}\n\`\`\``, content: `\`\`\`${extension}\n${safeSlice(text, 2000 - 6 - extension.length)}\n\`\`\``,
components: [ components: [