mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-11-10 01:08:07 +01:00
feat: use rs for formatting zig files
This commit is contained in:
parent
d08964c2cf
commit
9af4671f43
1 changed files with 3 additions and 1 deletions
|
@ -47,7 +47,7 @@ async function handleGithubLink(message: Message) {
|
|||
|
||||
const repo = groups.repo;
|
||||
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 secondLineNumber = parseInt(groups.second_line_number) || firstLineNumber + 1;
|
||||
|
||||
|
@ -74,6 +74,8 @@ async function handleGithubLink(message: Message) {
|
|||
// delete the last \n
|
||||
text = text.slice(0, -1);
|
||||
|
||||
if (extension === "zig") extension = "rs";
|
||||
|
||||
message.reply({
|
||||
content: `\`\`\`${extension}\n${safeSlice(text, 2000 - 6 - extension.length)}\n\`\`\``,
|
||||
components: [
|
||||
|
|
Loading…
Reference in a new issue