diff --git a/bun.lockb b/bun.lockb index e1065dd..6aee8d4 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/listeners/message_create.ts b/src/listeners/message_create.ts index e309ce3..96f722a 100644 --- a/src/listeners/message_create.ts +++ b/src/listeners/message_create.ts @@ -3,7 +3,7 @@ import { defineListener } from "../loaders/listeners.ts"; import { MESSAGE_PREFIX, BUN_ONLY_CHANNEL_ID } from "../constants.ts"; import { COMMANDS } from "../loaders/commands.ts"; import { MessageCommandContext } from "../structs/context/CommandContext.ts"; -import { extname } from "node:path"; +import { extname, basename } from "node:path"; import { safeSlice } from "../util.ts"; const GITHUB_LINE_URL_REGEX = /(?:https?:\/\/)?(?:www\.)?(?:github)\.com\/(?[a-zA-Z0-9-_]+\/[A-Za-z0-9_.-]+)\/blob\/(?.+?)#L(?\d+)[-~]?L?(?\d*)/i; @@ -90,7 +90,7 @@ async function handleGithubLink(message: Message) { if (extension === "zig") extension = "rs"; message.reply({ - content: `\`\`\`${extension}\n${safeSlice(text, 2000 - 6 - extension.length)}\n\`\`\``, + content: `***${basename(path)}*** — *(L${firstLineNumber}${secondLineNumber ? `-L${secondLineNumber}` : ""})*\n\`\`\`${extension}\n${safeSlice(text, 2000 - 6 - extension.length)}\n\`\`\``, components: [ new ActionRowBuilder() .setComponents(