codePreviews: fix line number regex

This commit is contained in:
Cynthia Foxwell 2022-05-07 17:06:31 -06:00
parent 4c681a137e
commit fa91219714
1 changed files with 2 additions and 2 deletions

View File

@ -44,12 +44,12 @@ events.add("messageCreate", "codePreviews", async function (msg) {
? ""
: fileName.substring(fileName.indexOf(".") + 1);
const lineStr = link.match(/#L\d+?(-L\d+?)?/)?.[0];
const lineStr = link.match(/#L\d+(-L\d+)?/)?.[0];
let startLine, endLine;
let entireFile = false;
if (lineStr) {
let [start, end] = link.match(/L\d+?/g);
let [start, end] = link.match(/L\d+/g);
start = parseInt(start.replace("L", ""));
if (!end) {
startLine = endLine = start;